title: DrawerLayout item click replace fragment from backstack is wrong position
body: <p>In my app has 5 fragment (FragA, FragB, FragC, FragD, FragE)</p>
  
  <p>Step 1. When app start FragA is open</p>
  
  <p>Step 2. I click on drawerlayout item to open FragB then FragB is open </p>
  
  <p>Step 3. I click on drawerlayout item to open FragC then FragC is open</p>
  
  <p>Step 4. I click on drawerlayout item to open FragB then FragB is open</p>
  
  <p>Step 5. I click on back button it's return from FragB to FragA not FragC. Why?</p>
  
  <p>I think on Step 4 it's bring FragB to front and destroy FragC (not re sort position of backstack)</p>
  
  <p>I want to bring selected fragment to front and sort position of backstack(not destroy) same this</p>
  
  <pre><code>1.before click drawerlayout item to open FragB again
  FragA--&gt;FragB--&gt;FragC
  2.after click drawerlayout item to open FragB
  FragA--&gt;FragC--&gt;FragB
  </code></pre>
  
  <p>How to fix it's?</p>
  
  <p>this is method i use to replace fragment</p>
  
  <pre><code>public void replaceFragment (Fragment fragment){
      String backStateName =  fragment.getClass().getName();
      String fragmentTag = backStateName;
  
      FragmentManager manager = getFragmentManager();
  
      boolean fragmentPopped = manager.popBackStackImmediate(backStateName, 0);
  
      if (!fragmentPopped &amp;&amp; manager.findFragmentByTag(fragmentTag) == null){ //fragment not in back stack, create it.
          FragmentTransaction ft = manager.beginTransaction();
          ft.replace(R.id.frame_container, fragment, fragmentTag);
          ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
          ft.addToBackStack(backStateName);
          ft.commit();
      }
  }
  </code></pre>