Creating a TabHost with Tabs containing Activities WITHOUT extending TabActivity

by mscwd01 » Tue, 09 Dec 2008 01:45:24 GMT


Sponsored Links
 I need a way to create a TabHost which has an intent as the tabs
content, e.g:

TabHost tabs = (TabHost)findViewById(R.id.tabhost);
tabs.setup();
TabSpec spec1 = tabs.newTabSpec("TabOne");
spec1.setIndicator("Tab One", this.getResources().getDrawable
(R.drawable.tab_icon));
spec1.setContent(new Intent(this, MyTabClass.class));
tabs.addTab(spec1);

Without extending TabActivity.

I am currently extending MapActivity, which I cannot change as it is
needed. Therefore, I currently get the following error at runtime,
when the tab is clicked:
java.lang.IllegalStateException: Did you forget to call 'public void
setup(LocalActivityManager activityGroup)'?

Is there a way to call "setup(LocalActivityManager activityGroup)"
WITHOUT extending TabActivity?

Please say there is ;)

Thanks


--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Copying 1 drawable to SD

I wanna copy a drawable to the sd card.
Lets say I have picture
1.jpg
in my drawable folder and I want the app to copy it to the sd card
when a certain button is pressed how can I do this>?

-- 

2. flashing element in ArrayAdapter

I have an ArrayAdapter in my activity, and when a certain event occur,
I'd like to make a specific element flash, or have it highlighted in
some way for a couple of seconds.
Is there a way to do that?
Thanks,
Simone

-- 

3. PVMFOMXVideoDecNode

4. Behaviour of launchMode=鈥?singleTask鈥?not as described?

5. Debugging Methods n booting time?

6. build/target/product or Vendo

7. Setting Display panel size for android.