title: Android fragment back press without any data loss
body: <p>I am creating an application with navigation drawer when I click each navigation list new fragments will load. One of the fragment have listView. When I click this list load another fragment. Now I move to different fragments using navigation drawer. When I press back button every time I want to move to previous fragment without any data change.How can I do it?</p>
  
  <p>I am loading fragment using the following code:</p>
  
  <pre><code>FragmentManager fm = getFragmentManager();
          for (int i = 0; i &lt; fm.getBackStackEntryCount(); i++) {
              fm.popBackStack();
          }
      FragmentTransaction fragmentTransaction = fm.beginTransaction();
              fragmentTransaction.replace(R.id.fragmentHome, fr);
              fragmentTransaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
              fragmentTransaction.commit();
  </code></pre>
  
  <p><strong>In short::  Every back press I want to load previous fragment without recreating it</strong></p>