Android で単一の選択設定から対応する番号を取得しようとしていますが、何らかの理由で LogCat に「getInt で文字列を整数にキャストできない」と表示されます。 mEventLanguageSelection 割り当ての時点で、 と表示されていますがKEY_LANGUAGE_SELECTION_LIST=2
、これは getInt が値 2 を返す必要があることを意味していると確信しています。
EventsActivity.java
http://pastebin.com/85qa72bN
strings_activity_settings.xml
http://pastebin.com/LBVqpjMF
pref_general.xml
http://pastebin.com/NGcRwGhz
09-22 20:38:25.056: D/libEGL(28573): loaded /vendor/lib/egl/libEGL_POWERVR_SGX540_120.so
09-22 20:38:25.064: D/libEGL(28573): loaded /vendor/lib/egl/libGLESv1_CM_POWERVR_SGX540_120.so
09-22 20:38:25.071: D/libEGL(28573): loaded /vendor/lib/egl/libGLESv2_POWERVR_SGX540_120.so
09-22 20:38:25.181: D/OpenGLRenderer(28573): Enabling debug mode 0
09-22 20:38:33.157: D/dalvikvm(28573): GC_CONCURRENT freed 92K, 2% free 9117K/9240K, paused 3ms+2ms, total 25ms
09-22 20:39:33.759: D/AndroidRuntime(28573): Shutting down VM
09-22 20:39:33.759: W/dalvikvm(28573): threadid=1: thread exiting with uncaught exception (group=0x41415930)
09-22 20:39:33.790: E/AndroidRuntime(28573): FATAL EXCEPTION: main
09-22 20:39:33.790: E/AndroidRuntime(28573): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.barjinx.barjinx/com.barjinx.barjinx.EventsActivity}: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer
09-22 20:39:33.790: E/AndroidRuntime(28573): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
09-22 20:39:33.790: E/AndroidRuntime(28573): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
09-22 20:39:33.790: E/AndroidRuntime(28573): at android.app.ActivityThread.access$600(ActivityThread.java:141)
09-22 20:39:33.790: E/AndroidRuntime(28573): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
09-22 20:39:33.790: E/AndroidRuntime(28573): at android.os.Handler.dispatchMessage(Handler.java:99)
09-22 20:39:33.790: E/AndroidRuntime(28573): at android.os.Looper.loop(Looper.java:137)
09-22 20:39:33.790: E/AndroidRuntime(28573): at android.app.ActivityThread.main(ActivityThread.java:5039)
09-22 20:39:33.790: E/AndroidRuntime(28573): at java.lang.reflect.Method.invokeNative(Native Method)
09-22 20:39:33.790: E/AndroidRuntime(28573): at java.lang.reflect.Method.invoke(Method.java:511)
09-22 20:39:33.790: E/AndroidRuntime(28573): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
09-22 20:39:33.790: E/AndroidRuntime(28573): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
09-22 20:39:33.790: E/AndroidRuntime(28573): at dalvik.system.NativeStart.main(Native Method)
09-22 20:39:33.790: E/AndroidRuntime(28573): Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer
09-22 20:39:33.790: E/AndroidRuntime(28573): at android.app.SharedPreferencesImpl.getInt(SharedPreferencesImpl.java:240)
09-22 20:39:33.790: E/AndroidRuntime(28573): at com.barjinx.barjinx.EventsActivity.onCreate(EventsActivity.java:65)
09-22 20:39:33.790: E/AndroidRuntime(28573): at android.app.Activity.performCreate(Activity.java:5104)
09-22 20:39:33.790: E/AndroidRuntime(28573): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
09-22 20:39:33.790: E/AndroidRuntime(28573): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
09-22 20:39:33.790: E/AndroidRuntime(28573): ... 11 more