Java.lang.classcastexception Cannot Be Cast To Android.app.fragment
Solution 1:
You are attempting to cast a SupportMapFragment
to be a native API Level 11 android.app.Fragment
. That will not work. Either:
Set your
android:minSdkVersion
to 11 or higher, and useMapFragment
instead ofSupportMapFragment
, orCast your
SupportMapFragment
to be anandroid.support.v4.app.Fragment
The issue is if I extend it from FragmentActivity I cannot display ApplicationBar Tabs
The action bar was added to Android in API Level 11. If you wish to use an action bar on older versions of Android, you will need to use a backport, either ActionBarSherlock or the AppCompat backport in the Android Support package.
Solution 2:
If you are using com.google.android.gms.maps.SupportMapFragment your activity must extends android.support.v4.app.FragmentActivity instead of android.app.Activity
Post a Comment for "Java.lang.classcastexception Cannot Be Cast To Android.app.fragment"