Cannot be cast to android.app.Fragment

前端 未结 4 1402
攒了一身酷
攒了一身酷 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 21:41

    Another pitfall to watch out for is to make sure you don't forget to call super.onCreate() from your activity. If you make this dumb mistake like I did, you'll also see the "Error inflating class fragment" and "... cannot be cast to android.app.Fragment" errors, even if you haven't mismatched the standard and support.v4 versions of the classes.

提交回复
热议问题