アクションバーとタブを含むレイアウトがあります。
<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 style="@style/BackgroundLayer">
<!-- Action Bar with buttons -->
<include layout="@layout/incl_actionbar"/>
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="5dp" />
</LinearLayout>
</TabHost>
また、アクションバーには、タブ内のアクティビティからアクセスできるようにする必要があるいくつかのボタンがあります。しかし、findViewByIdは、アクションバーにあるすべてのビューに対してnullを返します-タブ内のすべてのアクティビティのcontentRootはFrameLayoutであるため(そしてアクションバーはその側にあります)、これは非常に論理的ですが、それでもアクションバーへのアクセスが必要です。現在利用可能なすべてのアクションがそこにあります。
また、アクションバーをタブ内のすべてのアクティビティのインテントに追加として渡すことも考えましたが、ビューはシリアル化もパーセル化もできないため、追加として渡すことはできません。