title: Fragment view in ViewPager is not restored when resuming
body: <p>I have ActionBar Tabs setup. It consists of 4 tabs. Everything is fine until I navigate away from <code>TabbedFragment</code> and returning back.</p>
  
  <p>I create tabs like this:</p>
  
  <pre><code>  @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
  
          final ActionBar actionBar = getActionBar();
  
          tabs = Lists.newArrayList();
          tabs.add(new TabDefinition&lt;&gt;("Tab 1"));
          tabs.add(new TabDefinition&lt;&gt;("Tab 2"));
          tabs.add(new TabDefinition&lt;&gt;("Tab 3"));
          tabs.add(new TabDefinition&lt;&gt;("Tab 4"));
  
  
          for (TabDefinition tab : tabs) {
              actionBar.addTab(actionBar.newTab()
                  .setText(tab.text)
                  .setTag(tab.tag)
                  .setTabListener(this));
          }
      }
  </code></pre>
  
  <p>And initialize adapter like this:</p>
  
  <pre><code>@Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
      return inflater.inflate(R.layout.paging_tab_container, container, false);
  }
  
  @Override
  public void onViewCreated(View view, Bundle savedInstanceState) {
      super.onViewCreated(view, savedInstanceState);
      viewPager = (ViewPager) view.findViewById(R.id.pager);
  
      viewPager.setAdapter(new FragmentStatePagerAdapter(getFragmentManager()) {
  
          @Override
          public Fragment getItem(int position) {
              return tabs.get(position).fragment;
          }
  
          @Override
          public int getCount() {
              return tabs.size();
          }
      });
  
      viewPager.setOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() {
          @Override
          public void onPageSelected(int position) {
              getActionBar().setSelectedNavigationItem(position);
          }
      });
  
      viewPager.setCurrentItem(getActionBar().getSelectedNavigationIndex(), true);
  }
  </code></pre>
  
  <p>When returning back to <code>TabbedFragment</code> selected tab and 1 next to it would not have any content. Just empty view. But if I select current + 2 fragment content is loaded. And then returning to that first fragment content is reloaded.<br>
  For example I have A, B, C, D tabs. Before leaving <code>TabbedFragment</code> I had selected tab A.
  When returning to <code>TabbedFragment</code> I still am at tab A, but it's empty. So is tab B.<br>
  But when selecting tab C it is created and loaded. Returning to tab A it is recreated.</p>
  
  <p>What could be the problem here?</p>