title: How to reload fragment when tab is selected?
body: <p>I have created a simple app with 3 tab TAB1, TAB2, TAB3
  When i select the TAB1 adjacent TAB2 get loaded into memory after that when i press on the TAB2 or TAB3 my content on the TAB2 will not get refresh.</p>
  
  <p>If i click tab in the sequence TAB1->TAB2->TAB1->TAB2 my fragment will not refresh</p>
  
  <p>I want load the selected tab each time when i select the tab.</p>
  
  <p>I am using the following code to load the fragment on tab selected</p>
  
  <pre><code>public class SampleFragmentPageAdapter extends FragmentStatePagerAdapter {
  
  final int PAGE_COUNT = 3;
  private String tabTitles[] = new String[]{"HOME", "BEACON", "NEARBY"};
  private int[] imageResId = {
          R.drawable.home,
          R.drawable.beacon,
          R.drawable.nearby
  };
  private Context context;
  
  public SampleFragmentPageAdapter(FragmentManager fm, Context context) {
      super(fm);
      this.context = context;
  }
  
  @Override
  public Fragment getItem(int position) {
      Fragment fragment = null;
      if (position == 0)
          fragment = new FragmentTab1();
      if (position == 1)
          fragment = new FragmentTab2();
      if (position == 2)
          fragment = new FragmentTab3();
      return fragment;
  }
  
  @Override
  public int getCount() {
      return PAGE_COUNT;
  }
  
  @Override
  public CharSequence getPageTitle(int position) {
      // Generate title based on item position
      Drawable image = context.getResources().getDrawable(imageResId[position]);
      image.setBounds(0, 0, 32, 32);
      // Replace blank spaces with image icon
      SpannableString sb = new SpannableString("   " + tabTitles[position]);
      ImageSpan imageSpan = new ImageSpan(image, ImageSpan.ALIGN_BOTTOM);
      sb.setSpan(imageSpan, 0, 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
      return sb;
  }
  
  @Override
  public Object instantiateItem(ViewGroup container, int position) {
      return super.instantiateItem(container, position);
  }
  
  @Override
  public void destroyItem(ViewGroup container, int position, Object object) {
      super.destroyItem(container, position, object);
  }
  }
  </code></pre>