
Untitled
By: a guest on
May 8th, 2012 | syntax:
None | size: 0.46 KB | hits: 12 | expires: Never
How do I add unique content to each tab in an Android app
TabHost host = findViewById(R.id.my_tabhost);
boolean boo = true; //Variable that will decide what tabs to add
host.setup(); //Need to call before adding tabs
if (boo)
host.addTab(host.newTabSpec("Hello").setIndicator("Hello").setContent(new Intent(this, HelloActivity.class)));
else
host.addTab(host.newTabSpec("Goodbye").setIndicator("Goodbye").setContent(new Intent(this, GoodbyeActivity.class));