Android-Customized TabHost
<p>I am not able to pass intent in customized tabHost.Please anyone help me.I try to pass intent from customtabactivity.java to  firsttab.java which contains the firsttab.xml as setcontentview.</p>

<h2>Main.xml</h2>

<pre><code>   &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent"&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"&gt;
        &lt;View android:layout_width="fill_parent" android:layout_height="0.5dip"
            android:background="#ff0000" /&gt;
        &lt;TabWidget android:id="@android:id/tabs"
            android:layout_width="fill_parent" android:layout_height="wrap_content"
            android:layout_marginLeft="0dip" android:layout_marginRight="0dip" /&gt;
        &lt;View android:layout_width="fill_parent" android:layout_height="2dip"
            android:background="#696969" /&gt;
        &lt;View android:layout_width="fill_parent" android:layout_height="2dip"
            android:background="#000" /&gt;
        &lt;FrameLayout android:id="@android:id/tabcontent"
            android:layout_width="fill_parent" android:layout_height="fill_parent" &gt;
            &lt;include layout="@layout/firsttab"/&gt;
            &lt;/FrameLayout&gt;
    &lt;/LinearLayout&gt;
&lt;/TabHost&gt;
</code></pre>

<p></p>

<h2>CustomTabHost.java</h2>

<pre><code> import android.app.Activity;
 import android.content.Context;
  import android.os.Bundle;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.Window;
 import android.widget.TabHost;
 import android.widget.TextView;
 import android.widget.TabHost.TabContentFactory;
 import android.widget.TabHost.TabSpec;
 import android.content.Intent;
 public class CustomTabActivity extends Activity {

private TabHost mTabHost;

private void setupTabHost() {
    mTabHost = (TabHost) findViewById(android.R.id.tabhost);

    mTabHost.setup();





}

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    // construct the tabhost
     requestWindowFeature(Window.FEATURE_LEFT_ICON);


        setContentView(R.layout.main);
        getWindow().setFeatureDrawableResource(Window.FEATURE_LEFT_ICON,R.drawable.headphones);
    setupTabHost();
    mTabHost.getTabWidget().setDividerDrawable(R.drawable.tab_divider);


    setupTab1(new TextView(this), "Showcase");
    setupTab2(new TextView(this), "Catalogue");


}

private void setupTab1(final View view, final String tag) {
    View tabview = createTabView(mTabHost.getContext(), tag);

    TabSpec setContent1 = mTabHost.newTabSpec(tag).setIndicator(tabview).setContent(new TabContentFactory() {
        public View createTabContent(String tag) {

            return view;}
    });


    mTabHost.addTab(setContent1);

}
private void setupTab2(final View view, final String tag) {
    View tabview = createTabView(mTabHost.getContext(), tag);

    TabSpec setContent = mTabHost.newTabSpec(tag).setIndicator(tabview).setContent(new TabContentFactory() {
        public View createTabContent(String tag) {

            return view;}
    });

    mTabHost.addTab(setContent);

}

private static View createTabView(final Context context, final String text) {
    View view = LayoutInflater.from(context).inflate(R.layout.tabs_bg, null);
    TextView tv = (TextView) view.findViewById(R.id.tabsText);
    tv.setText(text);
    return view;
}
</code></pre>

<p>}</p>

<h2>firsttab.xml</h2>

<pre><code> &lt;?xml version="1.0" encoding="UTF-8"?&gt;
 &lt;RelativeLayout  xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/background"
&gt;
 &lt;LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingTop="20dip"

 android:id="@+id/relative"&gt;
&lt;TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/New_Release"
android:textSize="15dip"

android:typeface="serif" 
android:layout_weight="1"/&gt;
&lt;TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/Featured_Artist"
android:textSize="15dip"
android:typeface="serif" 
android:layout_weight="1"/&gt;
&lt;TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/Crew_Picks"
android:textSize="15dip"

android:typeface="serif" 
android:layout_weight="1"/&gt; 
&lt;/LinearLayout&gt;     
  &lt;RelativeLayout
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
   android:orientation="vertical"
   android:paddingTop="20dip"
   android:layout_below="@id/relative"&gt;

  &lt;ImageView
   android:layout_width="55dip"
   android:layout_height="75dip"
   android:layout_weight="1"
   android:src="@drawable/da"
    android:padding="2dip"
   android:id="@+id/image1"/&gt;
 &lt;ImageView
    android:layout_width="55dip"
    android:layout_height="75dip"
android:layout_toRightOf="@id/image1"
android:layout_weight="1"
    android:src="@drawable/dd"
    android:padding="2dip"
    android:id="@+id/image2"
/&gt;  
   &lt;ImageView
    android:layout_width="100dip"
    android:layout_height="148dip"
    android:layout_toRightOf="@id/image2"

    android:src="@drawable/dd"
    android:padding="2dip"
    android:id="@+id/image3"/&gt;
    &lt;ImageView
    android:layout_width="55dip"
    android:layout_height="75dip"
    android:src="@drawable/da"
     android:layout_weight="1"
     android:padding="2dip"
     android:id="@+id/image4"
     android:layout_alignParentRight="true"/&gt;
     &lt;ImageView
     android:layout_width="55dip"
    android:layout_height="75dip"

android:layout_toLeftOf="@id/image4" 
android:padding="2dip"
android:layout_weight="1"
    android:src="@drawable/dd"
   android:id="@+id/image5"
    /&gt;      
    &lt;ImageView
    android:layout_width="55dip"
    android:layout_height="75dip"
android:layout_below="@id/image1" 
android:padding="2dip"
android:layout_weight="1"
android:id="@+id/image6"
     android:src="@drawable/dd"/&gt;
   &lt;ImageView
     android:layout_width="55dip"
    android:layout_height="75dip"
    android:layout_below="@id/image2"
android:layout_toRightOf="@id/image6"
android:padding="2dip"
android:layout_weight="1"
android:id="@+id/image7"
    android:src="@drawable/da"

     /&gt;             

   &lt;ImageView
    android:layout_width="55dip"
    android:layout_height="75dip"
    android:layout_alignParentRight="true"
android:layout_below="@id/image4" 
android:padding="2dip"
android:layout_weight="1"
android:id="@+id/image9"
     android:src="@drawable/da"

 /&gt;   
&lt;ImageView
     android:layout_width="55dip"
    android:layout_height="75dip"
android:layout_toLeftOf="@id/image9"
android:padding="2dip"
android:layout_below="@id/image5"
android:layout_weight="1"
android:id="@+id/image8"
    android:src="@drawable/dd"

   /&gt;          
  &lt;/RelativeLayout&gt;
  &lt;/RelativeLayout&gt;
</code></pre>

<h2>firsttab.java</h2>

<pre><code>  public class firsttab extends Activity {

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    /* First Tab Content */

    setContentView(R.layout.firsttab);

}
</code></pre>

<p>}</p>
