私はこれをカットしました次のコードに戻って、私はまだ、非デフォルトのタブを取得して、そのタブに移動する際の表示を再描画することはできません(背景色などの一部の部分が正しく更新されています)。
これは動作するように助言してくれて非常に感謝しています。選択したタブに応じて "Mode 1"または "Mode 2"が表示されますが、tabHost.setCurrentTab(1)文字列が赤または青い枠線が更新されます。
// THIS IS THE ENTRY POINT ////////////////////////////////////////////////
パブリッククラスTabTestはTabActivity
{意図意図を拡張し、 バンドルパラメータ。
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Resources res = getResources();
TabHost tabHost = getTabHost();
TabHost.TabSpec spec;
Intent intent;
// TEMPLATE
意図=新しいテント()setClass(この、TabContent.class)。 params = new Bundle(); params.putString( "TABNAME"、 "Mode 1"); intent.putExtras(params); spec = tabHost.newTabSpec( "Template")。setIndicator( "template"、
res.getDrawable(R.drawable.tab_pane)) .setContent(インテント); tabHost.addTab(spec);
// ATTEMPT intent = new Intent()。setClass(this、TabContent2.class); params = new Bundle(); params.putString( "TABNAME"、 "Mode 2"); intent.putExtras(params); spec = tabHost.newTabSpec( "試行")。setIndicator( "試行"、 res.getDrawable(R.drawable.tab_pane)) .setContent(インテント); tabHost。addTab(spec);
tabHost.setCurrentTab(1);
}
}
//タブコンテンツ1 ///////////////////////////////// ///////
パブリッククラスTabContentアクティビティ {ScreenWrite S = NULLを拡張します。 SurfaceView screen_1;
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.content);
Bundle params = this.getIntent().getExtras();
String name = params.getString("TABNAME");
screen_1=(SurfaceView)findViewById(R.id.screen_1);
s=new ScreenWrite((Context)this, screen_1, name);
}
}
//タブコンテンツ2 ///////////////////////////////// ///////
パブリッククラスTabContent2アクティビティ {ScreenWrite S = NULLを拡張します。 SurfaceView screen_2;
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.content2);
Bundle params = this.getIntent().getExtras();
String name = params.getString("TABNAME");
screen_2=(SurfaceView)findViewById(R.id.screen_2);
s=new ScreenWrite((Context)this, screen_2, name);
}
}
//コンテンツレイアウト///////////////////////////////// ///////
//と///// ///////////////////////////////////
////////////////////////////////////////
PSレイアウトは提出物から切り捨てられましたが、基本的に背景色とサーフェスビューの所有者にすぎません。明確ではないSurfaceViewを使用して