title: Android fragment tab host + viewpager swipe?
body: <p>I currently have a fragment tab host, made by this tutorial
  <a href="http://maxalley.wordpress.com/2013/05/18/android-creating-a-tab-layout-with-fragmenttabhost-and-fragments/" rel="nofollow">http://maxalley.wordpress.com/2013/05/18/android-creating-a-tab-layout-with-fragmenttabhost-and-fragments/</a></p>
  
  <p>The only difference is that I'm using this inside a fragment.
  So I have a fragment with the tabs, each tab has another fragment..</p>
  
  <p></p>
  
  <pre><code>&lt;LinearLayout
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical"&gt;
  
      &lt;TabWidget
          android:id="@android:id/tabs"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:layout_gravity="bottom" /&gt;
  
      &lt;FrameLayout
          android:id="@android:id/tabcontent"
          android:layout_width="fill_parent"
          android:layout_height="0dp"
          android:layout_weight="1" /&gt;
  
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p></p>
  
  <p>The fragment class</p>
  
  <pre><code>public class AddServiceFragment extends Fragment {
  
  
  
  
      public AddServiceFragment() {
          // Required empty public constructor
      }
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
  
  
      }
  
  
      public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
  
          View view = inflater.inflate(R.layout.fragment_add_service, container, false);
          FragmentTabHost mTabHost = (FragmentTabHost) view.findViewById(android.R.id.tabhost);
          mTabHost.setup(getActivity(), getChildFragmentManager(), android.R.id.tabcontent);
  
  
          String[] tabs = new String[]{"text1", "text2"};
          mTabHost.addTab(
                  mTabHost.newTabSpec("tab1").setIndicator(tabs[0], null),
                  MedicalHistoryFragment.class, null);
  
  
          mTabHost.addTab(
                  mTabHost.newTabSpec("tab2").setIndicator(tabs[1], null),
                  MedicalHistoryFragment.class, null);
  
              return view;
      }
  </code></pre>
  
  <p>This works, I can see my tabs.
  Now I want to implement a viewpager, in order to be able to swipe left or right.</p>
  
  <p>I've read this from the android developer page
  <a href="http://developer.android.com/training/animation/screen-slide.html" rel="nofollow">http://developer.android.com/training/animation/screen-slide.html</a></p>
  
  <p>But I can't figure out, where should I put my viewpager?
  I want my fragment to be independent of my activity...</p>