Googleのタブチュートリアルと非常によく似た基本的なTabActivityを設定します。ただし、TabWidgetの上に、各子タブ/子アクティビティで特定のイベントが発生した後(必ずしもタブを切り替える場合)にテキストを更新および変更したいTextViewがあります。アクティビティ間でイベントをバインドできない可能性があることに気付いたので、これを実現する方法について何かアイデアはありますか?TabActivityと子アクティビティの両方が通信するサービスを設定しますか?ここTabHostでTextViewを取得して、子アクティビティがアクティブなときに再描画することも可能ですか?
私のTabActivityは、次のビューを膨らませます。
<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">
<TextView android:id="@+id/textToUpdate" android:text="Some text to update" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
<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" />
</LinearLayout>