Для этого сначала создайте xml-файл. Пример файла показан ниже.
<?xml version="1.0" encoding="utf-8"?>
<TabHost android:layout_width="fill_parent"
android:layout_height="fill_parent" android:id="@android:id/tabhost"
xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@drawable/background">
<TabWidget android:layout_width="fill_parent" android:id="@android:id/tabs"
android:layout_height="wrap_content" />
<FrameLayout android:layout_width="fill_parent" android:id="@android:id/tabcontent"
android:layout_gravity="bottom" android:paddingTop="70dp"
android:layout_height="match_parent">
<ScrollView android:layout_height="fill_parent" android:id="@+id/viewTab1"
android:layout_width="match_parent">
<!-- Your view you want -->
</ScrollView>
<LinearLayout android:layout_width="fill_parent"
android:layout_height="fill_parent" android:id="@+id/viewTab2">
<!-- Your view you want -->
</LinearLayout>
<!-- Add as many view you want with unique id -->
</FrameLayout>
Каждый макет будет относиться к уникальной планировкой.
В главном использовании деятельности следующих
TabHost tabHost = getTabHost();
TabSpec spec1 = tabHost.newTabSpec("FirstTabView");
TabSpec spec2 = tabHost.newTabSpec("SecondTabView");
spec1.setContent(R.id.viewTab1);
spec1.setIndicator("First Tab");
spec2.setIndicator("Second Tab");
spec2.setContent(R.id.viewTab2);
tabHost.addTab(spec1);
tabHost.addTab(spec2);
tabHost.setup();
Вы можете добавить столько вкладок необходимо. И все это будет инициализировано в одно и то же время.
Надеюсь, это вам поможет :)