title: one Fragment to another Fragment on Button click
body: <p>I have learned how to change the fragment activity from one to another (all are fragment activities) on button click but now I am having issue with multiple button on same fragment. only first button id works. I have more than one button and each button has different fragment activity. need help</p>
  
  <pre><code>package com.test.fragmentation;
  
  import android.os.Bundle;
  import android.support.v4.app.Fragment;
  import android.support.v4.app.FragmentManager;
  import android.support.v4.app.FragmentTransaction;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.Button;
  
  public class List extends Fragment {
  
  
      public List() {
          // Required empty public constructor
      }
  
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
                               Bundle savedInstanceState) {
          // Inflate the layout for this fragment
          View rootView = inflater.inflate(R.layout.fragment_list, container, false);
  
  
          Button ID = (Button) rootView.findViewById(R.id.btnHello);
          ID.setOnClickListener(new View.OnClickListener() {
                  @Override
                  public void onClick(View view) {
                      FragmentManager fragmentManager = getFragmentManager();
                      FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
                      HelloFragment NAME = new HelloFragment();
                      fragmentTransaction.replace(R.id.fragment_container, NAME);
                      fragmentTransaction.commit();
  
                  }
              });
          return rootView;
      }
  }
  </code></pre>