I want to create tabs without extending TabActivity. (The reason is that TabActivity cannot handle a custom titlebar as it seems). I have
pu
Design considerations notwithstanding, the following does not work at all, and the API seems to indicate that setContent(Intent i)
is valid. This works when the activity extends TabActivity
, however, extending Activity
and adding setup()
call results in an exception at android.widget.TabHost$IntentContentStrategy.getContentView(TabHost.java:649)
Funny thing is, the LogCat suggests I forgot to call setup()
mTabHost = (TabHost) findViewById(android.R.id.tabhost);
mTabHost.setup();
Intent tab1Intent = new Intent(this, ActivityOne.class);
Button tab1View = new Button(this);
tab1View.setText("Activity 1");
mTabHost.addTab(mTabHost.newTabSpec("tab_1").setIndicator(tab1View).setContent(tab1Intent));