你如何使用 setCurrentTab 命令?这是我现在拥有的代码......当我调试它时,我得到“C:Tab 3”所以保存方面工作正常,但标签仍然没有改变?对我有什么帮助吗?谢谢!
TabHost th = (TabHost)findViewById(R.id.tabhost);
th.setup();
TabSpec specs = th.newTabSpec("tag1");
specs.setContent(R.id.tab1);
specs.setIndicator("Zone Manager");
th.addTab(specs);
specs = th.newTabSpec("tag2");
specs.setContent(R.id.tab2);
specs.setIndicator("",res.getDrawable(R.drawable.ic_tab_vaccontrol));
th.addTab(specs);
specs = th.newTabSpec("tag3");
specs.setContent(R.id.tab3);
specs.setIndicator("Tab 3");
th.addTab(specs);
Tab = (settings.getInt("Tab", 1));
Log.d("TabStuff", "C: Tab " + Tab);
th.setCurrentTab(Tab);