Lablayout and Linairlayout
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);
精彩评论