title: Refresh/Reload/Re instantiate a Fragment in an android tab system
body: <p>I have an activity with a viewpager that has 3 tabs and 3 fragments, inside each tab is a fragment. I know that the fragment manager stores the initial instances of the fragments so that if I swipe away from a tab then return to that tab, it is loaded in memory and no updates are applied to it. </p>
  
  <p>I need the opposite to happen, that is: Every time I swipe to a tab, a new instance of the fragment in that tab needs to load so that data will be updated.</p>
  
  <p>I have tried:</p>
  
  <blockquote>
    <ol>
    <li>detach attach fragment in onTabSelected (nothing happens) </li>
    <li>
    remove add fragment in onTabSelected (nothing happens) </li>
    <li>
    setOffscreenPageLimit(0) (Nothing happens) </li>
    <li>refresh function
    inside each fragment to be called onTabSelected (gives
    nullPointerException)</li>
    </ol>
  </blockquote>
  
  <p>I have been struggling with this problem for a week with no progress. I appreciate any help, be it a hint, a comment, a suggestion.</p>
  
  <p>Let me know what code should I post, Thanks.</p>