title: Android: Using ViewPager to swipe whole TabActivity
body: <p>I'm using TabManager to implement with Fragments a screen with tabs as described <a href="http://developer.android.com/resources/samples/Support4Demos/src/com/example/android/supportv4/app/FragmentTabs.html" rel="nofollow">here</a>. That screen displays information about a concrete object in a list. I'd like to swipe the whole screen so as to change the object being used. </p>
  
  <p>I've managed to use ViewPager inside one of the Fragments and got it working, but I'd like to swipe the tabs above too. I've tried to instantiate the ViewPager in the Activity using TabManager and creating a pager adapter which referenced the root view (TabHost) and returning it everytime ViewPager asked for a view, but it didn't work.</p>
  
  <p>Thank you very much in advance.</p>
  
  <p><strong>EDIT</strong> Here's the code of the class which hosts the tabs and the ViewPager:</p>
  
  <pre><code>public class FeederActivity extends RoboFragmentActivity implements OnPageChangeListener {
  
      @Inject FeederActivityPagerAdapter adapter;
      @InjectView(R.id.details) ViewPager viewPager;
  
      TabHost tabHost;
      TabManager tabManager;
  
      // Inside onCreate
      tabHost = (TabHost)findViewById(android.R.id.tabhost);
      tabHost.setup();
      tabManager = new TabManager(this, tabHost, R.id.realtabcontent);
  
      tabManager.addTab(tabHost.newTabSpec("state").setIndicator(getString(R.string.state)), StateFragment.class, null);
      tabManager.addTab(tabHost.newTabSpec("programming").setIndicator(getString(R.string.programming)), ProgrammingFragment.class, null);
      tabManager.addTab(tabHost.newTabSpec("plot").setIndicator(getString(R.string.plot)), PlotFragment.class, null);
      this.viewPager.setAdapter(this.adapter);
      this.viewPager.setOnPageChangeListener(this);
  }
  </code></pre>
  
  <p><a href="http://tinypic.com/r/fk3z8g/5" rel="nofollow">Here</a> is a screenshot of what I have by now. </p>
  
  <p>It displays information of Feeder 6. I'd like to swipe the whole screen (including the tabs State, Programming and Plot) so as to be in Feeder 7.  </p>