title: how to implement tabhost inside fragment?
body: <p>I try to put a tab host inside a frament but when run the code , the tabhost can not display</p>
  
  <p>java code of class extend fragment :</p>
  
  <pre><code> public View onCreateView(LayoutInflater inflater, ViewGroup container,
          Bundle savedInstanceState) {
  
      View rootView = inflater.inflate(R.layout.fragment_host_layout,
              container, false);
  
      setHasOptionsMenu(true);
  
      TabHost mTabHost = (TabHost) rootView.findViewById(R.id.tabhost);
  
  
      TabSpec photospec = mTabHost.newTabSpec("Search");
      photospec.setIndicator("Search", getResources().getDrawable(R.drawable.action_search));
      Intent searchIntent = new Intent(getActivity(), HostViewIntroduce.class);
      photospec.setContent(searchIntent);
  
      TabSpec songspec = mTabHost.newTabSpec("Favorites");
      // setting Title and Icon for the Tab
      songspec.setIndicator("Favorites", getResources().getDrawable(R.drawable.action_search));
      Intent favoriteIntent = new Intent(getActivity(), HostViewTips.class);
      songspec.setContent(favoriteIntent);
  
      return rootView;
  
  }
  </code></pre>
  
  <p>xml code :</p>
  
  <pre><code> &lt;LinearLayout
      android:id="@+id/thumbnail"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignParentLeft="true"
      android:layout_below="@+id/relativeLayout1"
      android:layout_marginRight="5dip"
      android:background="@drawable/image_bg"
      android:padding="3dip" &gt;
  
      &lt;ImageView
          android:id="@+id/userAvatar"
          android:layout_width="wrap_content"
          android:layout_height="89dp"
          android:src="@drawable/test_avatar" /&gt;
  &lt;/LinearLayout&gt;
  
  &lt;LinearLayout
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignBottom="@+id/thumbnail"
      android:layout_alignParentRight="true"
      android:layout_alignTop="@+id/thumbnail"
      android:layout_below="@+id/relativeLayout1"
      android:layout_toRightOf="@+id/thumbnail"
      android:orientation="vertical" &gt;
  
      &lt;TextView
          android:id="@+id/textView1"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:text="soloco bolo"
          android:textAppearance="?android:attr/textAppearanceMedium" /&gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content" &gt;
  
          &lt;ImageView
              android:id="@+id/ImageView01"
              android:layout_width="fill_parent"
              android:layout_height="fill_parent"
              android:layout_weight="1"
              android:src="@drawable/description_section_icon" /&gt;
  
          &lt;TextView
              android:id="@+id/textView2"
              android:layout_width="fill_parent"
              android:layout_height="fill_parent"
              android:text="123456"
              android:layout_weight="1"
              android:gravity="center_vertical"
              android:textAppearance="?android:attr/textAppearanceSmall" /&gt;
  
          &lt;ImageView
              android:id="@+id/imageView1"
              android:layout_width="fill_parent"
              android:layout_height="fill_parent"
              android:layout_weight="1"
              android:src="@drawable/ic_menu_add" /&gt;
      &lt;/LinearLayout&gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content" &gt;
  
          &lt;Button
              android:id="@+id/button1"
              style="?android:attr/buttonStyleSmall"
              android:layout_width="123dp"
              android:layout_height="wrap_content"
              android:layout_weight="1"
              android:text="Button" /&gt;
  
          &lt;Button
              android:id="@+id/button2"
              style="?android:attr/buttonStyleSmall"
              android:layout_width="125dp"
              android:layout_height="wrap_content"
                android:layout_weight="1"
              android:text="Button" /&gt;
      &lt;/LinearLayout&gt;
  
  &lt;/LinearLayout&gt;
  
  &lt;LinearLayout
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignParentLeft="true"
      android:layout_alignParentRight="true"
      android:layout_below="@+id/thumbnail" &gt;
  
      &lt;TextView
          android:id="@+id/textView3"
          android:layout_width="wrap_content"
          android:layout_height="match_parent"
          android:gravity="center_vertical"
          android:text="Đà Nẵng"
          android:textAppearance="?android:attr/textAppearanceLarge" /&gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:layout_weight="1"
          android:orientation="vertical" &gt;
  
          &lt;TextView
              android:id="@+id/textView4"
              android:layout_width="match_parent"
              android:layout_height="68dp"
              android:gravity="center_vertical"
              android:text="Activate"
              android:textAppearance="?android:attr/textAppearanceMedium" /&gt;
  
          &lt;TextView
              android:id="@+id/textView5"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:gravity="center_vertical"
              android:text="6/1/2013-7/1/2013"
              android:textAppearance="?android:attr/textAppearanceSmall" /&gt;
      &lt;/LinearLayout&gt;
  &lt;/LinearLayout&gt;
  
  &lt;LinearLayout
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_above="@+id/relativeLayout2"
      android:layout_alignParentLeft="true"
      android:layout_alignParentRight="true"
      android:orientation="vertical" &gt;
  
      &lt;TabHost
          android:id="@+id/tabhost"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:layout_weight="1.30" &gt;
  
          &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="match_parent"
                  android:layout_height="92dp" &gt;
              &lt;/TabWidget&gt;
  
              &lt;FrameLayout
                  android:id="@android:id/tabcontent"
                  android:layout_width="match_parent"
                  android:layout_height="match_parent" &gt;
  
                  &lt;LinearLayout
                      android:id="@+id/tab1"
                      android:layout_width="match_parent"
                      android:layout_height="match_parent"
                      android:orientation="vertical" &gt;
  
                      &lt;ListView
                          android:id="@+id/tab1list_place_list"
                          android:layout_width="fill_parent"
                          android:layout_height="wrap_content"
                          android:divider="#b5b5b5"
                          android:dividerHeight="1dp"
                          android:listSelector="@drawable/list_selector" &gt;
                      &lt;/ListView&gt;
                  &lt;/LinearLayout&gt;
  
                  &lt;LinearLayout
                      android:id="@+id/tab2"
                      android:layout_width="match_parent"
                      android:layout_height="match_parent"
                      android:orientation="vertical" &gt;
  
                      &lt;ListView
                          android:id="@+id/tab2list_place_list"
                          android:layout_width="fill_parent"
                          android:layout_height="wrap_content"
                          android:divider="#b5b5b5"
                          android:dividerHeight="1dp"
                          android:listSelector="@drawable/list_selector" /&gt;
                  &lt;/LinearLayout&gt;
  
                  &lt;LinearLayout
                      android:id="@+id/tab3"
                      android:layout_width="match_parent"
                      android:layout_height="match_parent"
                      android:orientation="vertical" &gt;
  
                      &lt;ListView
                          android:id="@+id/tab3list_place_list"
                          android:layout_width="fill_parent"
                          android:layout_height="wrap_content"
                          android:divider="#b5b5b5"
                          android:dividerHeight="1dp"
                          android:listSelector="@drawable/list_selector" /&gt;
                  &lt;/LinearLayout&gt;
              &lt;/FrameLayout&gt;
          &lt;/LinearLayout&gt;
      &lt;/TabHost&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>and here is the screen shot :</p>
  
  <p><img src="https://i.stack.imgur.com/ReQwF.png" alt="https://dl.dropboxusercontent.com/u/37599516/Untitled.png"></p>
  
  <p>and here is exactly what I want it to be</p>
  
  <p><a href="https://dl.dropboxusercontent.com/u/37599516/Untitled.png" rel="nofollow noreferrer">https://dl.dropboxusercontent.com/u/37599516/Untitled.png</a></p>