2016-08-13 11 views
0

私のアプリで設定アクティビティに戻ると、私のアプリがアクティビティを強制的に停止するように強制されますが、どのミスがあるのか​​分かりません。 。事前にあなたの助けをありがとう!私はあなたが同じidが異なるウィジェットで共有されていないことを確認することをお勧めしたい、前にこれらのClassCastExceptionsを経験した前のアクティビティに戻ったときにエラーが発生する

08-13 11:36:36.355 21968-21968/com.example.user.dictationapp E/AndroidRuntime: FATAL EXCEPTION: main 
                      Process: com.example.user.dictationapp, PID: 21968 
                      java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.user.dictationapp/com.example.user.dictationapp.DictationVocab}: java.lang.ClassCastException: android.view.AbsSavedState$1 cannot be cast to android.widget.CompoundButton$SavedState 
                       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2202) 
                       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2252) 
                       at android.app.ActivityThread.access$800(ActivityThread.java:139) 
                       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1200) 
                       at android.os.Handler.dispatchMessage(Handler.java:102) 
                       at android.os.Looper.loop(Looper.java:136) 
                       at android.app.ActivityThread.main(ActivityThread.java:5103) 
                       at java.lang.reflect.Method.invokeNative(Native Method) 
                       at java.lang.reflect.Method.invoke(Method.java:515) 
                       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790) 
                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:606) 
                       at dalvik.system.NativeStart.main(Native Method) 
                      Caused by: java.lang.ClassCastException: android.view.AbsSavedState$1 cannot be cast to android.widget.CompoundButton$SavedState 
                       at android.widget.CompoundButton.onRestoreInstanceState(CompoundButton.java:378) 
                       at android.view.View.dispatchRestoreInstanceState(View.java:12842) 
                       at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2658) 
                       at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2658) 
                       at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2658) 
                       at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2658) 
                       at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2658) 
                       at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2658) 
                       at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2658) 
                       at android.view.View.restoreHierarchyState(View.java:12820) 
                       at com.android.internal.policy.impl.PhoneWindow.restoreHierarchyState(PhoneWindow.java:1874) 
                       at android.app.Activity.onRestoreInstanceState(Activity.java:949) 
                       at android.app.Activity.performRestoreInstanceState(Activity.java:921) 
                       at android.app.Instrumentation.callActivityOnRestoreInstanceState(Instrumentation.java:1138) 
                       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180) 
                       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2252) 
                       at android.app.ActivityThread.access$800(ActivityThread.java:139) 
                       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1200) 
                       at android.os.Handler.dispatchMessage(Handler.java:102) 
                       at android.os.Looper.loop(Looper.java:136) 
                       at android.app.ActivityThread.main(ActivityThread.java:5103) 
                       at java.lang.reflect.Method.invokeNative(Native Method) 
                       at java.lang.reflect.Method.invoke(Method.java:515) 
                       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790) 
                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:606) 
                       at dalvik.system.NativeStart.main(Native Method) 

答えて

0
android.view.AbsSavedState$1 cannot be cast to android.widget.CompoundButton$SavedState 

。また、同じ条件の異なるレイアウト修飾子フォルダ内のレイアウトで確認してください。

関連する問題