title: How to create a tabhost in android programming using XML and rename every tab?
body: <p>I know that my question is really basic, but believe me, I can't find a reliable tutorial that will teach me on how to use TabHost in android programming step by step for a beginner like me.</p>
  
  <p>My problem is I dragged a tabhost in Eclipse to my layout, and I inserted a textview on every linearlayout but when I installed it on my phone, only the textview of the second tab is visible on the application. I don't know if there is a compatibility issue but here is my code: </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:android1="http://schemas.android.com/apk/res/android"
      android:id="@+id/sel"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical" &gt;
  
      &lt;TextView
          android1:id="@+id/activityhead"
          android1:layout_width="match_parent"
          android1:layout_height="74dp"
          android1:text="TextView" /&gt;
  
      &lt;LinearLayout
          android1:layout_width="match_parent"
          android1:layout_height="129dp"
          android1:orientation="vertical" &gt;
  
          &lt;ImageButton
              android1:id="@+id/imageButton1"
              android1:layout_width="124dp"
              android1:layout_height="match_parent"
              android1:scaleType="fitStart"
              android1:src="@drawable/button1" /&gt;
  
      &lt;/LinearLayout&gt;
  
      &lt;TabHost
          android1:id="@android:id/tabhost"
          android1:layout_width="match_parent"
          android1:layout_height="match_parent" &gt;
  
          &lt;LinearLayout
              android1:layout_width="match_parent"
              android1:layout_height="match_parent"
              android1:orientation="vertical" &gt;
  
              &lt;TabWidget
                  android1:id="@android:id/tabs"
                  android1:layout_width="match_parent"
                  android1:layout_height="wrap_content"
  
                   &gt;
  
              &lt;/TabWidget&gt;
  
              &lt;FrameLayout
                  android1:id="@android:id/tabcontent"
                  android1:layout_width="match_parent"
                  android1:layout_height="match_parent" &gt;
  
                  &lt;LinearLayout
                      android1:id="@+id/tab1"
                      android1:orientation="vertical"
                      android1:layout_width="match_parent"
                      android1:layout_height="match_parent" &gt;
  
                      &lt;TextView
                          android1:id="@+id/textv1"
                          android1:layout_width="match_parent"
                          android1:layout_height="80dp"
                          android1:text="Sample Text 1"
                          &gt;
                       &lt;/TextView&gt;
                  &lt;/LinearLayout&gt;
  
                  &lt;LinearLayout
                      android1:id="@+id/tab2"
                      android1:orientation="vertical"
                      android1:layout_width="match_parent"
                      android1:layout_height="match_parent" &gt;
  
                       &lt;TextView
                          android1:id="@+id/textv2"
                          android1:layout_width="match_parent"
                          android1:layout_height="80dp"
                          android1:text="Sample Text 2"
                          &gt;
                       &lt;/TextView&gt;
                  &lt;/LinearLayout&gt;
  
  
              &lt;/FrameLayout&gt;
          &lt;/LinearLayout&gt;
      &lt;/TabHost&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Also, I don't know how to change the name of the tabs in tabhost. </p>