title: Tabhost returns null in android when comes back from activitiy and goto tab frament
body: <p>When I open the application for the first time my tab is working fine. When I come back and go to the fragment page some times it returns null. Please help me ! What am I doing wrong? Here is my code. </p>
  
  <pre><code>public class TabsFragmentPagerAdapter extends FragmentPagerAdapter {
  
      private ArrayList&lt;ShareWinLeaderBoardTabModel&gt; mShareWinLeaderBoardTabModelList;
      public TabsFragmentPagerAdapter(FragmentManager fragmentManager, ArrayList&lt;ShareWinLeaderBoardTabModel&gt; shareWinLeaderBoardTabModelList) {
          super(fragmentManager);
          mShareWinLeaderBoardTabModelList = shareWinLeaderBoardTabModelList;
      }
  
      @Override
      public Fragment getItem(int position) {
          /*ShareWinLeaderBoardTabModel model = Once that is donemShareWinLeaderBoardTabModelList.get(position);
          return new ShareWinLeaderBoardListFragment(model);*/
  
          switch (position) {
          case 0:
              ShareWinLeaderBoardTabModel model = mShareWinLeaderBoardTabModelList.get(position);
              return new ShareWinLeaderBoardListFragment(model);
          case 1:
              ShareWinLeaderBoardTabModel model1 = mShareWinLeaderBoardTabModelList.get(position);
              return new ShareWinLeaderBoardListFragment(model1);
          case 2:
              ShareWinLeaderBoardTabModel model2 = mShareWinLeaderBoardTabModelList.get(position);
              return new ShareWinLeaderBoardListFragment(model2);
          case 3:
              ShareWinLeaderBoardTabModel model3 = mShareWinLeaderBoardTabModelList.get(position);
              return new ShareWinLeaderBoardListFragment(model3);
          default:
              return null;
          }
      }
  
      @Override
      public int getCount() {
          return mShareWinLeaderBoardTabModelList.size();
      }
  
  }
  </code></pre>
  
  <p>When I press back there is some problem with the tab host. Tabs are coming fine but they are showing blank fragments. Any Help?</p>
  
  <p>Image: </p>
  
  <p><img src="https://i.stack.imgur.com/8mtS0.png" alt="enter image description here"></p>