I have the following in a class for creating a FragmentTabHost
:
public class TabsActivity extends FragmentActivity {
private FragmentTabHost mTabHost;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.tabs);
mTabHost = (FragmentTabHost)findViewById(android.R.id.tabhost);
mTabHost.setup(this, getSupportFragmentManager(), R.id.realtabcontent);
TabHost.TabSpec exploreSpec = mTabHost.newTabSpec("explore").setIndicator("Explore", getResources().getDrawable(R.drawable.exploreicon));
mTabHost.addTab(exploreSpec);
}
}
I have a separate .xml file for setting up the host as shown in the android support site. This is all in a second activity. My primary activity has a group of images. Clicking one loads this activity. The app runs initially. As soon as I tap an image to load this activity though it crashes. Inside LogCat I found the following error:
java.lang.IllegalArgumentException: you must specify a way to create the tab content
I can't seem to find any thing on this error.