Cannot be cast to android.app.Fragment

前端 未结 4 1390
攒了一身酷
攒了一身酷 2021-02-03 21:22

I\'m just trying to have a look on Fragment and I got some probs with stupid stuff... There is my SkippersActivity.java :

public class SkippersActivity extends A         


        
4条回答
  •  余生分开走
    2021-02-03 22:00

    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.

提交回复
热议问题