title: FragmentManager.popBackStack() does not simply loads the previous Fragment
body: <p>I have a main <strong>TabActivity</strong> which has two tabs, A and B (for now). Tab A loads a FragmentActivity (code given below) which just conatains a <code>FrameLayout</code>, so I can load my Fragments for that specific Tab in it.</p>
  
  <p>The first Fragment has some TextViews and one <strong>ListView</strong>. Data is pulled from a web service. When I click on an ListView's item, I load that item's detail in another Fragment (this also comes from a web service) and replace the current Fragment (with ListView and other controls) with another detail fragment.</p>
  
  <p>To achieve this, I am using <strong>android-support-v4.jar</strong> library to use Fragments as they were preferred.</p>
  
  <p>Tab A's FragmentActivity's XML:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
      &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"
          android:orientation="vertical" &gt;
  
          &lt;FrameLayout
              android:id="@+id/updates_frame"
              android:layout_width="fill_parent"
              android:layout_height="fill_parent"
              android:background="@drawable/background"/&gt;
      &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Tab A's FragmentActivity Java code:</p>
  
  <pre><code>public class UpdatesFragmentActivity extends FragmentActivity implements
      IUpdateNotifier {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.updates);
  
          //Load Initial Fragment into FrameLayout
          //I am adding this Fragment to BackStack
          Fragment newFragment = new UpdatesFragment();
          FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
          ft.addToBackStack(null);
          ft.add(R.id.updates_frame, newFragment);
          ft.commit();
      }
  
      //This is an Interface method which I call with the clicked "FEED" object to load its detail in another Fragment
      @Override
      public void onFeedSelected(Feed feed) {
          // Instantiate a new fragment.
          Fragment newFragment = new FeedDetailFragment(feed);
  
          // Add the fragment to the activity, pushing this transaction
          // on to the back stack.
          FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
          ft.replace(R.id.updates_frame, newFragment);
          ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
          ft.addToBackStack(null);
          ft.commit();
      }
  
      //This is another Interface Method which I call when the user presses "BACK".
      //I am trying to load the previously loaded Fragment, which I added to BackStack.
      //But this causes reconstruction of the previously loaded fragment. LIST in this case
      //which call the web service. I DONT WANT TO CALL SERVICE AGAIN.
      @Override
      public void onBackPressed() {
          FragmentManager fm = getSupportFragmentManager();
          if (fm.getBackStackEntryCount() &gt; 0) {
              fm.popBackStack();
          }
      }
  }
  </code></pre>
  
  <p>I have created an interface <strong>IUpdateNotifier</strong>, which contains two methods:</p>
  
  <pre><code>public void onFeedSelected(Feed feed);
  public void onBackPressed();
  </code></pre>
  
  <p>Parent <strong>UpdatesFragmentActivity</strong> implements these methods. I call these methods from children Fragments upon following actions.</p>
  
  <ol>
  <li>I call <strong>onFeedSelected(Feed feed)</strong> from the Fragment which has a <strong>ListView</strong>. I send the clicked feed item to parent FragmentActivity, so it loads another Fragment which would contain that feed detail.</li>
  <li>I call <strong>onBackPressed()</strong> from the second feed detail Fragment when the user presses a button that is supposed to bring back the first fragment which contained ListView with other controls. As you can see, I try to call <strong>FragmentManager's popBackStack()</strong> method to bring back that first Fragment...</li>
  </ol>
  
  <p>But the first Fragment gets refreshed and loads all the data from web service.</p>
  
  <p>Actually I cannot get and store data only once nor the updates are frequent on some time intervals. The user can update the list when he wants. Initially, the list loads the top 10 items from the service, and then user can click the "More" button at the end of list if he wants to load more items. </p>
  
  <p>It will load the next 10 items and so on. But I think I can store the retrieved ArrayList in some variable in <strong>UpdatesFragmentActivity</strong> and then just reassign that ArrayList to the list's adapter instead of loading the data from service, but I don't know how to make Fragment not to call service again.</p>
  
  <p>I want it to behave like when I click on tab 2 and then on tab 1 again. It simply shows the loaded data as if was hidden and does not call the service.</p>
  
  <p>How can I achieve this?</p>