TomGarden / Tetris

Sky overcast
1 stars 1 forks source link

java.lang.RuntimeException: Unable to start activity ComponentInfo{io.github.TomGarden.tetris/io.github.TomGarden.tetris.Activities.CustomGameStyleActivity}: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer #22

Open TomGarden-2 opened 5 years ago

TomGarden-2 commented 5 years ago
/*Device Info*/
[硬]设备制造商=Genymotion
[硬]设备型号=Custom
[硬]CPU型号=null
[硬]RAM=1.04 GB
[硬]ROM=13.38 GB
[OS][三方定制系统版本]=Android/vbox86p/vbox86p:8.0.0/OPR6.170623.017/32:userdebug/test-keys
[OS]产品名称(adb shell)=vbox86p
[OS][系统名称]=Android
[OS][Android版本]=8.0.0(26)
[app]versionName=1.0
[app]versionCode=1
/*Exception*/
java.lang.RuntimeException: Unable to start activity ComponentInfo{io.github.TomGarden.tetris/io.github.TomGarden.tetris.Activities.CustomGameStyleActivity}: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2817)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892)
    at android.app.ActivityThread.-wrap11(Unknown Source:0)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593)
    at android.os.Handler.dispatchMessage(Handler.java:105)
    at android.os.Looper.loop(Looper.java:164)
    at android.app.ActivityThread.main(ActivityThread.java:6541)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer
    at android.app.SharedPreferencesImpl.getInt(SharedPreferencesImpl.java:272)
    at io.github.TomGarden.tetris.Fragments.SettingGameStylePreferenceFragment.initPreference(SettingGameStylePreferenceFragment.java:100)
    at io.github.TomGarden.tetris.Fragments.SettingGameStylePreferenceFragment.onCreate(SettingGameStylePreferenceFragment.java:84)
    at android.app.Fragment.performCreate(Fragment.java:2593)
    at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1234)
    at android.app.FragmentManagerImpl.addAddedFragments(FragmentManager.java:2415)
    at android.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2194)
    at android.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2148)
    at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2049)
    at android.app.FragmentManagerImpl.dispatchMoveToState(FragmentManager.java:3044)
    at android.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:2991)
    at android.app.FragmentController.dispatchActivityCreated(FragmentController.java:178)
    at android.app.Activity.performCreateCommon(Activity.java:6969)
    at android.app.Activity.performCreate(Activity.java:6977)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1213)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2770)
    ... 9 more
java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer
    at android.app.SharedPreferencesImpl.getInt(SharedPreferencesImpl.java:272)
    at io.github.TomGarden.tetris.Fragments.SettingGameStylePreferenceFragment.initPreference(SettingGameStylePreferenceFragment.java:100)
    at io.github.TomGarden.tetris.Fragments.SettingGameStylePreferenceFragment.onCreate(SettingGameStylePreferenceFragment.java:84)
    at android.app.Fragment.performCreate(Fragment.java:2593)
    at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1234)
    at android.app.FragmentManagerImpl.addAddedFragments(FragmentManager.java:2415)
    at android.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2194)
    at android.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2148)
    at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2049)
    at android.app.FragmentManagerImpl.dispatchMoveToState(FragmentManager.java:3044)
    at android.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:2991)
    at android.app.FragmentController.dispatchActivityCreated(FragmentController.java:178)
    at android.app.Activity.performCreateCommon(Activity.java:6969)
    at android.app.Activity.performCreate(Activity.java:6977)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1213)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2770)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892)
    at android.app.ActivityThread.-wrap11(Unknown Source:0)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593)
    at android.os.Handler.dispatchMessage(Handler.java:105)
    at android.os.Looper.loop(Looper.java:164)
    at android.app.ActivityThread.main(ActivityThread.java:6541)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
TomGarden-2 commented 5 years ago
/*Device Info*/
[硬]设备制造商=Genymotion
[硬]设备型号=Custom
[硬]CPU型号=null
[硬]RAM=1.04 GB
[硬]ROM=13.38 GB
[OS][三方定制系统版本]=Android/vbox86p/vbox86p:8.0.0/OPR6.170623.017/32:userdebug/test-keys
[OS]产品名称(adb shell)=vbox86p
[OS][系统名称]=Android
[OS][Android版本]=8.0.0(26)
[app]versionName=1.0
[app]versionCode=1
/*Exception*/
java.lang.RuntimeException: Unable to start activity ComponentInfo{io.github.TomGarden.tetris/io.github.TomGarden.tetris.Activities.CustomGameStyleActivity}: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2817)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892)
    at android.app.ActivityThread.-wrap11(Unknown Source:0)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593)
    at android.os.Handler.dispatchMessage(Handler.java:105)
    at android.os.Looper.loop(Looper.java:164)
    at android.app.ActivityThread.main(ActivityThread.java:6541)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer
    at android.app.SharedPreferencesImpl.getInt(SharedPreferencesImpl.java:272)
    at io.github.TomGarden.tetris.Fragments.SettingGameStylePreferenceFragment.initPreference(SettingGameStylePreferenceFragment.java:100)
    at io.github.TomGarden.tetris.Fragments.SettingGameStylePreferenceFragment.onCreate(SettingGameStylePreferenceFragment.java:84)
    at android.app.Fragment.performCreate(Fragment.java:2593)
    at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1234)
    at android.app.FragmentManagerImpl.addAddedFragments(FragmentManager.java:2415)
    at android.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2194)
    at android.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2148)
    at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2049)
    at android.app.FragmentManagerImpl.dispatchMoveToState(FragmentManager.java:3044)
    at android.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:2991)
    at android.app.FragmentController.dispatchActivityCreated(FragmentController.java:178)
    at android.app.Activity.performCreateCommon(Activity.java:6969)
    at android.app.Activity.performCreate(Activity.java:6977)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1213)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2770)
    ... 9 more
java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer
    at android.app.SharedPreferencesImpl.getInt(SharedPreferencesImpl.java:272)
    at io.github.TomGarden.tetris.Fragments.SettingGameStylePreferenceFragment.initPreference(SettingGameStylePreferenceFragment.java:100)
    at io.github.TomGarden.tetris.Fragments.SettingGameStylePreferenceFragment.onCreate(SettingGameStylePreferenceFragment.java:84)
    at android.app.Fragment.performCreate(Fragment.java:2593)
    at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1234)
    at android.app.FragmentManagerImpl.addAddedFragments(FragmentManager.java:2415)
    at android.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2194)
    at android.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2148)
    at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2049)
    at android.app.FragmentManagerImpl.dispatchMoveToState(FragmentManager.java:3044)
    at android.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:2991)
    at android.app.FragmentController.dispatchActivityCreated(FragmentController.java:178)
    at android.app.Activity.performCreateCommon(Activity.java:6969)
    at android.app.Activity.performCreate(Activity.java:6977)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1213)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2770)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892)
    at android.app.ActivityThread.-wrap11(Unknown Source:0)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593)
    at android.os.Handler.dispatchMessage(Handler.java:105)
    at android.os.Looper.loop(Looper.java:164)
    at android.app.ActivityThread.main(ActivityThread.java:6541)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
TomGarden-2 commented 5 years ago
/*Device Info*/
[硬]设备制造商=Genymotion
[硬]设备型号=Custom
[硬]CPU型号=null
[硬]RAM=1.04 GB
[硬]ROM=13.38 GB
[OS][三方定制系统版本]=Android/vbox86p/vbox86p:8.0.0/OPR6.170623.017/32:userdebug/test-keys
[OS]产品名称(adb shell)=vbox86p
[OS][系统名称]=Android
[OS][Android版本]=8.0.0(26)
[app]versionName=1.0
[app]versionCode=1
/*Exception*/
java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer
    at android.app.SharedPreferencesImpl.getInt(SharedPreferencesImpl.java:272)
    at android.preference.Preference.getPersistedInt(Preference.java:1756)
    at android.preference.Preference.persistInt(Preference.java:1720)
    at io.github.TomGarden.tetris.CustomWeights.SettingActivity.TomEditTextPreference.persistInt(TomEditTextPreference.java:75)
    at io.github.TomGarden.tetris.Fragments.SettingGameStylePreferenceFragment.lpBGChange(SettingGameStylePreferenceFragment.java:476)
    at io.github.TomGarden.tetris.Fragments.SettingGameStylePreferenceFragment.access$800(SettingGameStylePreferenceFragment.java:57)
    at io.github.TomGarden.tetris.Fragments.SettingGameStylePreferenceFragment$2.onPreferenceChange(SettingGameStylePreferenceFragment.java:230)
    at android.preference.Preference.callChangeListener(Preference.java:1079)
    at android.preference.ListPreference.onDialogClosed(ListPreference.java:282)
    at android.preference.DialogPreference.onDismiss(DialogPreference.java:395)
    at android.app.Dialog$ListenersHandler.handleMessage(Dialog.java:1361)
    at android.os.Handler.dispatchMessage(Handler.java:105)
    at android.os.Looper.loop(Looper.java:164)
    at android.app.ActivityThread.main(ActivityThread.java:6541)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)