title: Refresh Fragment in ViewPager using FragmentStatePagerAdapter
body: <p>I am using a viewPager for its swipe abilities to swipe between two Fragments. However I want to refresh the Fragment contents on swipe. The FragmentStatePagerAdapter does a very good job of caching so its hard to get the Fragment to reload.
  I've tried putting everything in the onResume method but that has no effect.</p>
  
  <p>My Adapter is pretty simple:</p>
  
  <pre><code>public class AdapterHomePre extends FragmentStatePagerAdapter {
  
      ArrayList&lt;Fragment&gt; mFrags = new ArrayList&lt;Fragment&gt;();
  
      public AdapterHomePre(FragmentManager fm) {
          super(fm);
  
          mFrags.add(new FragmentOne());
          mFrags.add(new FragmentTwo());
      }
  
      @Override
      public int getCount() {
          return mFrags.size();
      }
  
      @Override
      public Fragment getItem(int position) {
          return mFrags.get(position);
      }
  }
  </code></pre>
  
  <p>I've tried all sorts of things as suggested on stack overflow, including as suggested this:</p>
  
  <pre><code>@Override
  public int getItemPosition(Object object) {
      return POSITION_NONE;
  }
  </code></pre>
  
  <p>Which makes no difference.</p>
  
  <p>I don't really want to destroy the fragment each time, but I've not even been able to get that working. </p>