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
Drawable-Hdpi, Drawable-Mdpi, Drawable-Ldpi Android
Cannot Catch Toolbar Home Button Click Event
Create New Project on Android, Error: Studio Unknown Host 'Services.Gradle.Org'
Search in Listview with Edittext
Fragment Transaction Animation: Slide in and Slide Out
Cannot Launch Avd in Emulator:Qt Library Not Found
How to Know When the Recyclerview Has Finished Laying Down the Items
Android - Switch Tabs from Within an Activity Within a Tab
How Does Evaluatejavascript Work
Android: Unable to Instantiate Activity/Classnotfoundexception
Error:Cause: Unable to Find Valid Certification Path to Requested Target
How to Get the Fragment Instance from the Fragmentactivity
Upload an Image and Audio in One Request in Android
Android Asynctask Testing with Android Test Framework