0
我設置了一個與Google的選項卡教程非常相似的基本TabActivity。然而,在TabWidget上方,我有一個TextView,我想更新,並在每個子選項卡/子活動中觸發某些事件(不一定在切換選項卡時)後更改文本。我意識到我可能無法在活動之間綁定事件,因此有關如何實現此目的的任何想法?設置TabActivity和兒童活動通過的服務?在兒童活動處於活動狀態時,甚至可以在TabHost中將TextView放在這裏甚至重新繪製?將子選項卡內容中的「事件」傳遞給父TabActivity
我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>