Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Occasional crash on load #37

Open
jvoll opened this issue Mar 11, 2012 · 1 comment
Open

Occasional crash on load #37

jvoll opened this issue Mar 11, 2012 · 1 comment
Assignees

Comments

@jvoll
Copy link
Member

jvoll commented Mar 11, 2012

Stack trace from Android developer console:

java.lang.RuntimeException: Unable to start activity ComponentInfo{me.taedium.android/me.taedium.android.view.ViewRecommendation}: android.support.v4.app.Fragment$InstantiationException: Unable to instantiate fragment me.taedium.android.view.RecommendationAdapter$RecFragment: make sure class name exists, is public, and has an empty constructor that is public
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
at android.app.ActivityThread.access$1500(ActivityThread.java:117)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3683)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.support.v4.app.Fragment$InstantiationException: Unable to instantiate fragment me.taedium.android.view.RecommendationAdapter$RecFragment: make sure class name exists, is public, and has an empty constructor that is public
at android.support.v4.app.Fragment.instantiate(Fragment.java:388)
at android.support.v4.app.FragmentState.instantiate(Fragment.java:96)
at android.support.v4.app.FragmentManagerImpl.restoreAllState(FragmentManager.java:1662)
at android.support.v4.app.FragmentActivity.onCreate(FragmentActivity.java:192)
at me.taedium.android.view.ViewRecommendation.onCreate(ViewRecommendation.java:45)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
... 11 more
Caused by: java.lang.InstantiationException: me.taedium.android.view.RecommendationAdapter$RecFragment
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1409)
at android.support.v4.app.Fragment.instantiate(Fragment.java:377)
... 17 more

@ghost ghost assigned jvoll Mar 11, 2012
jvoll added a commit that referenced this issue Mar 11, 2012
@jvoll
Copy link
Member Author

jvoll commented Mar 11, 2012

I think I've fixed this by following the instructions on http://developer.android.com/reference/android/app/Fragment.html

"All subclasses of Fragment must include a public empty constructor. The framework will often re-instantiate a fragment class when needed, in particular during state restore, and needs to be able to find this constructor to instantiate it. If the empty constructor is not available, a runtime exception will occur in some cases during state restore."

We will push an update to the app tonight and see if it is fixed. Will close if we don't get any of these bug reports in the next week or so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant