我已经完成TabActivity
了这段代码:
addTab(publication, "First", My_Files.class);
addTab(shop, "Second", Others.class);
private void addTab(String labelId, int drawableId, Class<?> c)
{
TabHost tabHost = getTabHost(); // The activity TabHost
Intent intent = new Intent(this, c);
TabHost.TabSpec spec = tabHost.newTabSpec("tab" + labelId);
View tabIndicator = LayoutInflater.from(this).inflate(R.layout.tab_indicator, getTabWidget(), false);
TextView title = (TextView) tabIndicator.findViewById(R.id.title);
title.setText(labelId);
ImageView icon = (ImageView) tabIndicator.findViewById(R.id.icon);
icon.setImageResource(drawableId);
spec.setIndicator(tabIndicator);
spec.setContent(intent);
tabHost.addTab(spec);
}
在这些第一个和第二个选项卡中,我有一些上下文,用户按下它并使用以下代码ListView
转到其他选项卡:Activity
Intent intent = new Intent("android.app.reader.FILES");
intent.putExtra("publicatonName", "fileName");
startActivity(intent);
但是我的消失了TabActivity
,但我仍然想像 iPhone 一样使用
UITabBar
它UINavigationController
所以现在我在想,当我去其他地方时,Activity
我需要将当前TabActivity
按钮类目标更改为当前,并且我Tab Bar Activity
应该以某种方式可见。
也许有人可以帮助我。
谢谢。