title: Fragment not replacing properly in second time android
body: <p>I am having FragmentDetail.java file which consist of recylerview,when touch on recylerview the same fragment FragmentDetail.java is called,Same process when i repeat 4 5 times by touching two simultaneously recyler view items. It does not show the back fragment immediately.Instead it shows the fragment of recyler view items.First Fragmet contains recylerview on which click ProductMenu calls,and on Product menu recyler view click FragmentDetail.java calls.So know what my problem is that on back press fragments are not getting replace properly.Below is my code :-</p>
  
  <p>FirstFragment</p>
  
  <pre><code>list_recycler.addOnItemTouchListener(new RecyclerTouchListener(getActivity(), list_recycler, new ClickListener() {
              @Override
              public void onClick(View view, int position) {
                  Fragment fragment = new ProductMenu();
  
                  fragmentManager = getActivity().getSupportFragmentManager();
  
  
                  fragmentTransaction = fragmentManager
                          .beginTransaction();
                  fragmentTransaction.setCustomAnimations(R.anim.slide_in, R.anim.slide_out, R.anim.slide_enter, R.anim.slide_exit);
                  fragmentTransaction.replace(R.id.container_body, fragment);
                  fragmentTransaction.addToBackStack(null);
                  fragmentTransaction.commit();
  
          }
  </code></pre>
  
  <p>ProductMenu.java</p>
  
  <pre><code>Also contains the same code.In spite of fragment FragmentDetail fragment = new FragmentDetail();
  </code></pre>
  
  <p>FragmentDetail.java</p>
  
  <pre><code>FragmentDetail fragment = new FragmentDetail();
                  ProductsBean productsBean = arr_related_product.get(position);              
  
                  fragmentManager = getActivity().getSupportFragmentManager();
                  //final int newBackStackLength = fragmentManager.getBackStackEntryCount() +1;
                  fragmentTransaction = fragmentManager
                          .beginTransaction();
                  fragmentTransaction.setCustomAnimations(R.anim.slide_in, R.anim.slide_out, R.anim.slide_enter, R.anim.slide_exit);
                  fragmentTransaction.replace(R.id.container_body, fragment);
                  fragmentTransaction.commit();
  </code></pre>