0
アプリケーションは初期タブはので、私が欲しいもの、リストビューで「Comunidade」で起動すると、あなたが変更()
TabHost th = (TabHost) findViewById(R.id.tabhost);
th.setup();
TabSpec specs = th.newTabSpec("Comunidade");
specs.setContent(R.id.tab1);
specs.setIndicator("Comunidade");
th.addTab(specs);
specs = th.newTabSpec("Notícias");
specs.setContent(R.id.tab2);
specs.setIndicator("Notícias");
th.addTab(specs);
specs = th.newTabSpec("Web");
specs.setContent(R.id.tab3);
specs.setIndicator("Web");
th.addTab(specs);
を見ることができるように私は私のTabHostで3つのタブがありますアイテムのリストをクリックすると、ビューはタブに移動します"Web"。ここで
は方法は次のとおりです。事前に
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
public void onItemClick(AdapterView<?> av, View v, int pos, long id) {
ourweb.loadUrl(listadesites.get(pos).getEndereço());
//CODE THAT I NEED
}
});
感謝。このような
感謝。 **編集**: 問題は、tabhostをインスタンス変数のように宣言しなければならないということでした。 – unpix
少なくとも3つのタブがTabHostに追加されている限りはそうではありません。例外ログの取り扱いは? –
これは今、感謝K-バロ! – unpix