Inconvertible types cannot cast android app fragment
Get via App Store Read this post in our app!
Cannot be cast to android.app.Fragment
I'm just trying to have a look on Fragment and I got some probs with stupid stuff. There is my SkippersActivity.java :
And my skippers_fragment.xml :
And there is my SkippersFragment.xml :
If I had to guess, SkippersFragment is extending android.support.v4.app.Fragment . However, SkippersActivity is not extending android.support.v4.app.FragmentActivity . So SkippersActivity is trying to use native API Level 11 fragments.
If you use the v4 compatibility package, your Activity has to extend FragmentActivity, not Activity. If you use Android > 3.0, then your Activity extends Activity, but read CommonsWare's answer about not mixing both types of fragments.