Я создал класс, который хочу использовать для создания вкладок (я не хочу использовать Activity).Теперь мой файл tabs.xml содержит:
<?xml version="1.0" encoding="utf-8"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/tab_host"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:padding="5dp" >
<TabWidget
android:id="@+id/tabs" //Not @android:id="@android:id/tabs
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<FrameLayout
android:id="@+id/tabcontent" //Not@android:id="@android:id/tabcontent
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<include
android:id="@+id/tab_horizontal_scroll" layout="@layout/gallerymodule"/>
</FrameLayout>
</LinearLayout>
</TabHost>
Я понимаю, что объект TabHost не извлекает ссылки на TabWidget и FrameLayout.
Я хотел бы знать, как добавить эти ссылки вручную?Спасибо.