Advertisement
alpine12

Untitled

Jul 27th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.41 KB | None | 0 0
  1. package p.alpine12.rootpixelproduct.fragment;
  2.  
  3.  
  4. import android.os.Bundle;
  5. import android.support.design.widget.BottomNavigationView;
  6. import android.support.v4.app.Fragment;
  7. import android.support.v7.widget.CardView;
  8. import android.view.LayoutInflater;
  9. import android.view.View;
  10. import android.view.ViewGroup;
  11. import android.widget.Button;
  12.  
  13. import p.alpine12.rootpixelproduct.R;
  14.  
  15. /**
  16.  * A simple {@link Fragment} subclass.
  17.  */
  18. public class HomeFragment extends Fragment {
  19.  
  20.  
  21.     public HomeFragment() {
  22.         // Required empty public constructor
  23.     }
  24.  
  25.  
  26.     @Override
  27.     public View onCreateView(LayoutInflater inflater, ViewGroup container,
  28.                              Bundle savedInstanceState) {
  29.         // Inflate the layout for this fragment
  30.  
  31.         View view = inflater.inflate(R.layout.fragment_home, container, false);
  32.         CardView btn_produk = (CardView) view.findViewById(R.id.cv_showProduk);
  33.         BottomNavigationView navigation = (BottomNavigationView) view.findViewById(R.id.navigation);
  34.         btn_produk.setOnClickListener(new View.OnClickListener() {
  35.             @Override
  36.             public void onClick(View v) {
  37.                 android.support.v4.app.FragmentTransaction fr = getFragmentManager().beginTransaction();
  38.                 fr.replace(R.id.fl_main, new Produk_Menu());
  39.                 fr.commit();
  40.         }
  41.         });
  42.  
  43.  
  44.  
  45.         return view;
  46.     }
  47.  
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement