title: Fragment popBackStack does not show previous fragment
body: <p>I want to go to the previous fragment when the back button is pressed:</p>
  <pre><code>@Override
      public void onBackPressed() {
          if(fragmentManager.getBackStackEntryCount() &gt; 0){
              fragmentManager.popBackStack();
          }
      }
  </code></pre>
  <p>This is how i inflate a fragment:</p>
  <pre><code>fragmentManager.beginTransaction().replace(R.id.mainFragment,new Fileexplorer()).addToBackStack(null).commit();
  </code></pre>
  <p>However, using replace() will not do anything.
  When i use add() it does work but everything gets overlapped.</p>
  <p>Can someone help me out please thanks.</p>