我有这个 Tabhost:
TabHost tabHost = getTabHost();
TabHost.TabSpec spec;
Intent intent;
/** Initialization Tab1 */
intent = new Intent(this, Tab1.Class);
spec = tabHost.newTabSpec("Tab1").setIndicator("Tab1").setContent(intent);
tabHost.addTab(spec);
/** Initialization Tab2 */
intent = new Intent(this, Abstand.class);
spec = tabHost.newTabSpec("Tab2").setIndicator("Tab2").setContent(intent);
tabHost.addTab(spec);
tabHost.setCurrentTab(0);
Tab2 的内容有一些按钮,当单击其中一个按钮时,它会启动一个 SubActivity:
final Intent i = new Intent(this, SubActivity.class);
final Bundle b = new Bundle();
this.mButton.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
b.putString("key", "value");
i.putExtras(b);
startActivityForResult(i, REQUEST_CODE);
}
});
在 SubActivity 中,Tabhost 不再可用......那么如何更改代码,在 SubActivity 中显示 Tabhost?