私は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);
}
これらの最初と 2 番目のタブにはListView
、ユーザーがそれを押すと、Activity
次のコードで他に移動するコンテキストを持つ s があります。
Intent intent = new Intent("android.app.reader.FILES");
intent.putExtra("publicatonName", "fileName");
startActivity(intent);
しかし、私の が消えますが、それでも iPhoneのTabActivity
ように使いたいです
UITabBar
UINavigationController
だから今、私は他のものに行くとき、現在のボタンクラスのターゲットを現在のActivity
ものに変更する必要があると考えています。TabActivity
Tab Bar Activity
誰かが私を助けてくれるかもしれません。
ありがとう。