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. Is there possible to load a shared library under /system/libs

Hi All,

I want to use an un-public class AmrInputStream.java. The class load a
jni interface media_jni.so

static
{
        System.loadLibrary("media_jni");
}

I can found the library media_jni.so under /system/lib. So I directly
put the class AmrInputStream to my application. It can compile,
however, when I run my application, it crashes after I call
AmrInputStream


Does anyone knows how to fix the crach? or how to use the shared
library on the phone.

Thanks!

Cindy



I copy the source code to my project, i6t can

-- 

2. Low Level Android Driver Programming

I am working with a hardware vendor on a new ruggedized android
tablet.  I am looking for some contacts for some low level developers
that could help interface their scanner, rfid reader and camera into
an android build.  I have no idea where to start looking for this type
of person / company.  Can anyone throw me a contact or lead?

--G

-- 

3. Problem building Android Kernel v2.6.32

4. Weekly Poll: Does Android Have a "Dude" Problem?

5. android:protectionLevel 鈥渟ignature鈥?with multiple certificates and sharedUid

6. .wav won't run

7. android:protectionLevel 鈥?signature鈥?with multiple certificates and sharedUid