tags:

views:

24

answers:

1

Hi,

I am trying to make a app with the tuotrail of the developerspage, then I would like to display a main.xml in a tabview, instead the textview, wich in the tuotrail,is in the activity. How do I tell my tab in activity do display the main.xml?

Thanks!

A: 

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);
roundhill
Thank you! I have tryed it, but maybe this is above my knowledge (dont have much experience with android)Is there a basis tuotrail (besides the developers page) on tabs, wich includes a main.xml in a tab build in, so I can have an easy start.Thanks!
cirrus75
This should do:http://dewful.com/?p=15
roundhill