title: FragmentStatePagerAdapter not refreshed
body: <p>I have a fragment which includes several pagers which are using FragmentStatePagerAdapter as adapters. It works fine the first time when the fragment is created. But when I the fragment is created the second time (for example when I switch tab), the FragmentStatePagerAdapter is not updated at all. Here is my code:</p>
  <pre><code>public class MyPagerAdapter extends FragmentStatePagerAdapter {
  
      private Activity m_activity;
  
      public MyPagerAdapter(Activity activity) {
          super(fm);
  
          m_activity = activity;
          refresh();
      }
  
      @Override
      public Fragment getItem(int position) {
          return this.m_fragments.get(position);
      }
  
      @Override
      public int getCount() {
          return this.m_fragments.size();
      }
  
      private void refresh() {
  
          m_fragments = new ArrayList&lt;MyData&gt;();
  
          // ......
          // after getting data from internet
          notifyDataSetChanged();
  
     }
  }
  </code></pre>
  <p>I found the getItem is called the first time. But it's not called the second time although refresh/getCount got called successfully and the data returned from internet is also correct.</p>
  <p>What could be reason why the getItem() is not called after the notifyDataSetChanged()? Thanks</p>
  <p><strong>P.S.</strong>: It will be fine when I rotate the device. The getItem() will be called correctly.</p>
  <p><strong>Edit:</strong> The code for the fragment which will use this adapter.</p>
  <pre><code>@Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
                               Bundle savedInstanceState) {
  
      View rootView = inflater.inflate(R.layout.home_fragment, container, false);
  
      // section 1
      m_sectionPager1 = (ViewPager)rootView.findViewById(R.id.sectionPager1);
  
      // section 2
      m_sectionPager2 = (ViewPager)rootView.findViewById(R.id.sectionPager2);
  
      return rootView;
  }
  
  @Override
  public void onActivityCreated (Bundle savedInstanceState) {
      super.onActivityCreated(savedInstanceState);
  
      // 1
      m_section1Adapter = new MyPagerAdapter(this.getActivity());
      m_sectionPagerLatest.setAdapter(m_section1Adapter);
  
      // 2
      m_section2Adapter = new MyPagerAdapter(this.getActivity());
      m_sectionPagerHottest.setAdapter(m_section2Adapter);
  }
  </code></pre>