ianhanniballake/TripleSolitaire — Issue #33: Crash on first time load after update to 1.1
Author: ianhanniballake
Created: 2011-10-11 18:48:52+00:00
State: open
Labels: Crash

Crash due to change from auto_play preference from int to string - incorrect casting causes crash.

Exception class java.lang.ClassCastException
Source method SharedPreferencesImpl.getString()

java.lang.RuntimeException: Unable to create application com.github.triplesolitaire.TripleSolitaireApplication: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:3699)
at android.app.ActivityThread.access$1200(ActivityThread.java:122)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1062)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:132)
at android.app.ActivityThread.main(ActivityThread.java:4123)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:491)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String
at android.app.SharedPreferencesImpl.getString(SharedPreferencesImpl.java:203)
at android.preference.Preference.getPersistedString(Preference.java:1369)
at android.preference.ListPreference.onSetInitialValue(ListPreference.java:278)
at android.preference.Preference.dispatchSetInitialValue(Preference.java:1285)
at android.preference.Preference.onAttachedToHierarchy(Preference.java:1097)
at android.preference.PreferenceGroup.addPreference(PreferenceGroup.java:156)
at android.preference.PreferenceGroup.addItemFromInflater(PreferenceGroup.java:97)
at android.preference.PreferenceGroup.addItemFromInflater(PreferenceGroup.java:38)
at android.preference.GenericInflater.rInflate(GenericInflater.java:488)
at android.preference.GenericInflater.rInflate(GenericInflater.java:493)
at android.preference.GenericInflater.inflate(GenericInflater.java:326)
at android.preference.GenericInflater.inflate(GenericInflater.java:263)
at android.preference.PreferenceManager.inflateFromResource(PreferenceManager.java:269)
at android.preference.PreferenceManager.setDefaultValues(PreferenceManager.java:462)
at android.preference.PreferenceManager.setDefaultValues(PreferenceManager.java:440)
at com.github.triplesolitaire.TripleSolitaireApplication.onCreate(TripleSolitaireApplication.java:27)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:968)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:3696)
... 10 more