<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TabHost
android:id="@+id/tabHost"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TabWidget
android:id="@android:id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:id="@+id/first_tab"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
//YOUR FIRST VIEW CREATE OR INCLUDE VIEW
<include
android:id="@+id/first_tab"
layout="@layout/first_tab" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/secend_tab"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
//YOUR SECEND VIEW CREATE OR INCLUDE VIEW
<include
android:id="@+id/secend_tab"
layout="@layout/secend_tab" />
</RelativeLayout>
</FrameLayout>
</LinearLayout>
</TabHost>
</LinearLayout>
и код в вашей деятельности, диалог и т.д.
TabHost host = (TabHost) findViewById(R.id.tabHost);
host.setup();
//Tab 1
TabHost.TabSpec spec = host.newTabSpec("firstTab");
spec.setContent(R.id.first_tab);
spec.setIndicator("TABE ONE");
host.addTab(spec);
//Tab 2
spec = host.newTabSpec("secendTab");
spec.setContent(R.id.secend_tab);
spec.setIndicator("TAB TWO");
host.addTab(spec);
- это решение или нет –