Android Exception: Did You Forget to Call 'Public Void Setup (Localactivitymanager Activitygroup)'

java.lang.IllegalStateException..... at tabhost.add(tabspec);

you are extending Activity class, try extending TabActivity class

or

if you want to use the Activity class then use the following :

host = (TabHost) findViewById(R.id.tabhost); //here tabHost will be your Tabhost
LocalActivityManager mLocalActivityManager = new LocalActivityManager(mActivity, false);
mLocalActivityManager.dispatchCreate(state); // state will be bundle your activity state which you get in onCreate
tabHost.setup(mLocalActivityManager);

Getting Fatal Exception with Tabs in Android application

Got the solution,
extended my class with ActivityGroup instead of Activity and added

tabHost.setup(this.getLocalActivityManager());



Related Topics



Leave a reply



Submit