Similar question to TabHost with Fragments and FragmentActivity.
I have an Android application that has been set at API level 10 for years. I still have the minimum version at 10, but the max version is now 21. I've installed the Android v4 support JAR and I am converting everything from Activity to Fragment Activity.
So, I have a main screen with a tab host. The following code is used:
TabSpec spec = tabHost.newTabSpec("photos")
.setIndicator(getString(R.string.Photos),
res.getDrawable(R.drawable.ics_menu_camera));
tabHost.addTab(spec, PhotosActivity.class, null);
The PhotosActivity used to extend the Activity
class and now extends the FragmentActivity
class. I simply get a cast error when the application opens. The only information is that PhotosActivity i what caused the cast error.
I tried changing this to extend Fragment
instead (like shown in the link I referenced), but nearly every line of code became a massive error inside the PhotosActivity.