Super.oncreate(savedinstancestate) Crashes When Activity Resumes
Solution 1:
E/AndroidRuntime(25512): Caused by: android.support.v4.app.Fragment$InstantiationException: Unable to instantiate fragment ambious.androidtroper.MainActivity$ArticleFragment: Ensure the following:
- Class name exists
- Class is public
- Class is static
- Empty public constructor exists
try this, making it static class:
publicstaticclassArticleFragmentextendsFragment {
publicArticleFragment(){
//Empty constructor
}
}
Solution 2:
A couple of things to check:
You should either remove the constructor on ArticleFragment, or be sure to call super() within your constructor.
Secondly, you might have to declare ArticleFragment as a static nested class within your activity. I typically write fragments as separate classes rather than as inner classes so I'm unsure of the ramifications to the android lifecycle when you declare them as you have..
Solution 3:
Process is killed and your data will be clear but when you resume app then method onCreate will be call and the state previously will try to restore. However, your app cannot restore. Because everything was cleared. the classes has been unloaded out of memory when other app need more memory.
Post a Comment for "Super.oncreate(savedinstancestate) Crashes When Activity Resumes"