title: popBackStackImmediate not showing fragment when the current fragment transaction is not added in the backstack
body: <p>Popbackstack is working fine when all the fragments in the sequence are added in the backstack but isnt working when one of the transactions is not added in the backstack.</p>
  
  <p>Here is my navigation:</p>
  
  <p>1.Replace fragment to load home fragment. This transaction not added to backstack.</p>
  
  <ol start="2">
  <li><p>Replace fragment to load login fragment. This transaction is added to backstack.</p>
  
  <p>3.Replace fragment to load loggedin fragment. This transaction is not added to backstack.</p>
  
  <p>Now, when i press back button once nothing happens. Whereas ideally it should go to the home fragment from logged in fragment.
  Here is my onbackpressed method in main activity:</p>
  
  <pre><code>@Override
  public void onBackPressed() {
      if(getSupportFragmentManager().getBackStackEntryCount()&gt;0)
      {
          FragmentManager.BackStackEntry backStackEntry = getSupportFragmentManager().getBackStackEntryAt(getSupportFragmentManager().getBackStackEntryCount() - 1);
          String str = backStackEntry.getName();
          FragmentManager fm=getSupportFragmentManager();
          //getSupportFragmentManager().popBackStackImmediate();
          fm.popBackStack(str, FragmentManager.POP_BACK_STACK_INCLUSIVE);
      }
      else {
          super.onBackPressed();
      }
  
  
  }
  </code></pre></li>
  </ol>