title: Creating FragmentTabHost causing some trouble
body: <p>So I'm developing an app and until now, I was using ordinary tab layout with two activities. Now someone told me that it's much better to do it usning FragmentTabHost. So I've been reading some <a href="http://developer.android.com/reference/android/support/v4/app/FragmentTabHost.html" rel="nofollow">docs</a> and this is what I came up with so far:</p>
  
  <p>MainActivity_Fragment:</p>
  
  <pre><code>public class MainActivity_Fragment extends Fragment {
  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container,
      Bundle savedInstanceState) {
      // Inflate the layout for this fragment
      return inflater.inflate(R.layout.activity_main, container, false);
      }
  
  }
  </code></pre>
  
  <p>RecordedLibrary_Fragment:</p>
  
  <pre><code>public class RecordedLibrary_Fragment extends Fragment {
  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container,
      Bundle savedInstanceState) {
      // Inflate the layout for this fragment
      return inflater.inflate(R.layout.activity_recorded_library, container, false);
      }
  }
  </code></pre>
  
  <p>TabLayout activity:</p>
  
  <pre><code>public class TabLayout extends FragmentActivity {
  
  //GLOBAL VARIABLES///////////////
  private FragmentTabHost mTabHost;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_tab_layout);
  
      mTabHost = (FragmentTabHost)findViewById(android.R.id.tabhost);
      mTabHost.setup(this, getSupportFragmentManager(), r.id....); // &lt;-- problem here
  
      mTabHost.addTab(mTabHost.newTabSpec("Recording").setIndicator("Recording"),
              MainActivity_Fragment.class, null);
  
      mTabHost.addTab(mTabHost.newTabSpec("Library").setIndicator("Library"),
              RecordedLibrary_Fragment.class, null);
      }
  }
  </code></pre>
  
  <p>Now this is where I am stuck. There are a few things that aren't explained in the docs. So I have two questions.</p>
  
  <p>This line in the docs:</p>
  
  <pre><code>mTabHost.setup(this, getSupportFragmentManager(), R.id.realtabcontent);
  </code></pre>
  
  <p>Where did they get R.id.realtabcontent ?</p>
  
  <p>And another thing that isn't explained; how should the xml of the tab activity look?</p>
  
  <p>My current tab layout xml:</p>
  
  <pre><code>&lt;TabHost xmlns:android="http://schemas.android.com/apk/res/android"
  android:id="@android:id/tabhost"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"&gt;
  &lt;LinearLayout
      android:orientation="vertical"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"&gt;
      &lt;TabWidget
          android:id="@android:id/tabs"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content" /&gt;
      &lt;FrameLayout
          android:id="@android:id/tabcontent"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"/&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p></p>
  
  <p>As you can see, the tab layout xml is still from the old tab layout. Do I need to adjust it to FragmentTabLayout or is it good this way?</p>