0
TextView
を含むカスタムレイアウトを持つTab
があります。 後でそのテキストを実際のタブの子から更新する必要があります。ここでカスタムタブのテキストを編集する
が、私は今...私はそれを設定する方法がありTabActivity
private void setupTab(final String tag) {
//Call createTabView() to give the tab a layout with some text
View tabview = createTabView(mTabHost.getContext(), tag);
Intent intent = new Intent().setClass(this, MyActivity.class);
TabSpec setContent = mTabHost.newTabSpec(tag).setIndicator(tabview).setContent(intent);
mTabHost.addTab(setContent);
mTabList.add(setContent);
}
private View createTabView(final Context context, final String text) {
View view = LayoutInflater.from(context).inflate(R.layout.tabs_bg, null);
TextView tv = (TextView) view.findViewById(R.id.tabsText);
tv.setText(text); //we set the text of the tab here.
LinearLayout tvX = (LinearLayout) view.findViewById(R.id.tabsLayout);
return view;
}
でそれを設定する方法です、子タブの活動に私はそれがテキストを更新する必要があります...私は思います私は...カスタムタブを持た
((TabActivity)getParent()).getTabHost().setTag(((TabActivity)getParent()).getTabHost().getCurrentTab(), "new text");
しかし、私はカスタムタブを必要とする:)
誰もが任意のアイデアや提案を持っていなかった場合、次は動作しますか? ありがとう