开发者

Lablayout and Linairlayout

开发者 https://www.devze.com 2022-12-26 09:54 出处:网络
I am trying to make a app 开发者_运维百科with the tutorial of the developers page, then I would like to display a main.xml in a tabview, instead the textview, which in the tutorial, is in the activity

I am trying to make a app 开发者_运维百科with the tutorial of the developers page, then I would like to display a main.xml in a tabview, instead the textview, which in the tutorial, is in the activity.

How do I tell my tab in activity do display the main.xml?


Set up your tabhost to have an activity in the tab, and then in that activity set its content view to your main.xml:

tabhost activity

TabHost host = getTabHost(); 
Intent tab1 = new Intent(this, main.class);
host.addTab(host.newTabSpec("one").setIndicator("Tab 1").setContent(tab1));

main.class

setContentView(setContentView(R.layout.main);
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号