2.2 api でかなり前にアプリケーションを開発し、多くのアクティビティを作成し、タブに TabActivity を使用しました。
現在、JellyBean バージョンで現在のアプリケーションを実行している場合、アプリケーションの実行中にタブが表示されず、ソース コードで Tabactivity が非推奨になったことを示しています。
また、下位互換性 v4 を読み、例 http://wptrafficanalyzer.in/blog/creating-navigation-tabs-using-tabhost-and-fragments-in-android/に従っています
結論: タブ定義の FragmentActivity には ListFragment が必要ですが、私たちの場合は Activity があるため、古いソースを変更せずに Activity を listfragment に変換するだけの解決策はありますか?
tabHost = (TabHost) findViewById(android.R.id.tabhost);
tabHost.setup();
tabIntent = new Intent(this, CatalogNavigationActivity.class);
productsTextView = new TextView(this);
productsTextView.setGravity(Gravity.CENTER);
productsTextView.setText(R.string.products);
productsTextView.setSingleLine(true);
productsTextView.setTextAppearance(this,R.style.TabText);
tabSpec = tabHost.newTabSpec("products").setIndicator(productsTextView).setContent(tabIntent);
tabHost.addTab(tabSpec);
事前にサンクス!