using tab Layout in android - Button added to one tab appears in all tabs
<p>Hi I'm following tutorial provided by google name hello-tabwidget.
To create tab menu.
Everything works fine but now I want to add a button to one tab but 
this button appears in all tabs.</p>

<p>Please can anyone help?</p>

<p>Thanks </p>

<p>this is what i have</p>

<pre><code>@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

Resources res = getResources(); // Resource object to get Drawables
TabHost tabHost = getTabHost();  // The activity TabHost
TabHost.TabSpec spec;  // Resusable TabSpec for each tab
Intent intent;  // Reusable Intent for each tab

// Create an Intent to launch an Activity for the tab (to be reused)
intent = new Intent().setClass(this, FirstTab.class);

// Initialize a TabSpec for each tab and add it to the TabHost
spec = tabHost.newTabSpec("First Tab").setIndicator("First Tab",
                  res.getDrawable(R.drawable.ic_tab_artists))
              .setContent(intent);
tabHost.addTab(spec);

// Do the same for the other tabs
intent = new Intent().setClass(this, SecondTab.class);
spec = tabHost.newTabSpec("Second Tab").setIndicator("Second Tab",
                  res.getDrawable(R.drawable.ic_tab_albums))
              .setContent(intent);
tabHost.addTab(spec);

intent = new Intent().setClass(this, ThirdTab.class);
spec = tabHost.newTabSpec("Third Tab").setIndicator("Third Tab",
                  res.getDrawable(R.drawable.ic_tab_songs))
              .setContent(intent);
tabHost.addTab(spec);

intent = new Intent().setClass(this, NextTab.class);
spec = tabHost.newTabSpec("Next Tab").setIndicator("Next Tab",
                  res.getDrawable(R.drawable.ic_tab_next))
              .setContent(intent);
tabHost.addTab(spec);

tabHost.setCurrentTab(0);
}
}
</code></pre>

<p>main.xml</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&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" 
    android:padding="5dp"&gt;

    &lt;FrameLayout android:id="@android:id/tabcontent" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:padding="5dp"&gt;

       &lt;include layout="@layout/tab1"/&gt;
       &lt;include layout="@layout/tab2"/&gt;
       &lt;include layout="@layout/tab3"/&gt;
       &lt;include layout="@layout/tab4"/&gt;

    &lt;/FrameLayout&gt;

  &lt;TabWidget android:id="@android:id/tabs" 
   android:layout_width="fill_parent" 
   android:layout_height="fill_parent"   
   android:gravity="bottom"/&gt;

 &lt;/LinearLayout&gt;
&lt;/TabHost&gt;
</code></pre>

<p>I created xml layout for each tab this is one with the button 
others are exactly this same just with out a button tag and with different id</p>

<p>tab2.xml</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
 &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content" 
android:layout_height="wrap_content"
android:id="@+id/tab2Layout" 
android:orientation="vertical"&gt;

&lt;Button android:text="@+id/Button01" 
  android:id="@+id/Button01"
  android:layout_width="wrap_content" 
  android:layout_height="wrap_content"&gt;
&lt;/Button&gt;
 &lt;/LinearLayout&gt;
</code></pre>

<p>and i created class for each tab this is code from second tab where i want to have a button
the other classes are exactly this same just </p>

<pre><code>setContentView(R.layout.tab2);
</code></pre>

<p>is set to point to different layouts</p>

<p>SecondTab.java</p>

<pre><code>public class SecondTab extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.tab2);


 }
}
</code></pre>

<p>Any ideas ??</p>

<p>Thanks</p>
