I have a simple Tablayout for four activites.
This is it’s xml
<?xml version="1.0" encoding="utf-8"?>
<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"
>
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:background="@drawable/bg1"
/>
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="0"
android:layout_marginBottom="-4dp"
/>
</LinearLayout>
</TabHost>
When it starts the activity connected to tab0 starts by default
What I need is to create start layout before any activity starts to look like the following
! [] http://i49.tinypic.com/2ugf3op.png
I don’t know where I should put the layout of the activity
By default in android, always the first tab is selected by default. What you can do to confuse the user that nothing is selected is that you change the drawables of the tabs. Make all tabs unselected by default, and in the frame layout you set the content as in image. Then as soon as the user clicks on the tab then change the color of that tab and then start the activity. The activity connected to tab0 will start by default always. But you can make a check condition there, that if the user has not clicked on anything then display some empty screen with background or otherwise start the activity.
UPDATE
By default open up some empty activity with some views according to your wish. This will be shown as soon as the user opens up the activity with the tabs. Then you can implment
OnTabChangeListeneron that activity and overide theonTabChanged()