有时会崩溃:

07-09 10:44:29.581  19036-19036/? E/AndroidRuntime﹕ FATAL EXCEPTION: main
    Process: toolbox.full, PID: 19036
    java.lang.RuntimeException: Unable to start activity ComponentInfo{toolbox.full/toolbox.full.setting.ASetting}: java.lang.RuntimeException: Parcel android.os.Parcel@2beebd43: Unmarshalling unknown type code 1279544898 at offset 2616
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2658)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2725)
            at android.app.ActivityThread.access$900(ActivityThread.java:172)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1422)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:145)
            at android.app.ActivityThread.main(ActivityThread.java:5834)
            at java.lang.reflect.Method.invoke(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:372)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1388)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1183)
     Caused by: java.lang.RuntimeException: Parcel android.os.Parcel@2beebd43: Unmarshalling unknown type code 1279544898 at offset 2616
            at android.os.Parcel.readValue(Parcel.java:2222)
            at android.os.Parcel.readArrayMapInternal(Parcel.java:2479)
            at android.os.BaseBundle.unparcel(BaseBundle.java:221)
            at android.os.Bundle.getParcelable(Bundle.java:804)
            at org.holoeverywhere.preference.Preference.dispatchRestoreInstanceState(Preference.java:145)
            at org.holoeverywhere.preference.PreferenceGroup.dispatchRestoreInstanceState(PreferenceGroup.java:90)
            at org.holoeverywhere.preference.PreferenceGroup.dispatchRestoreInstanceState(PreferenceGroup.java:90)
            at org.holoeverywhere.preference.Preference.restoreHierarchyState(Preference.java:935)
            at org.holoeverywhere.preference.PreferenceActivity.onRestoreInstanceState(PreferenceActivity.java:794)
            at android.app.Activity.performRestoreInstanceState(Activity.java:1027)
            at android.app.Instrumentation.callActivityOnRestoreInstanceState(Instrumentation.java:1175)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2631)
????????????at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2725)
????????????at android.app.ActivityThread.access$900(ActivityThread.java:172)
????????????at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1422)
????????????at android.os.Handler.dispatchMessage(Handler.java:102)
????????????at android.os.Looper.loop(Looper.java:145)
????????????at android.app.ActivityThread.main(ActivityThread.java:5834)
????????????at java.lang.reflect.Method.invoke(Native Method)
????????????at java.lang.reflect.Method.invoke(Method.java:372)
????????????at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1388)
????????????at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1183)

最佳答案

如果您有一个包含作为成员变量的模型的模型,则应用程序将引发此异常。

这样使用proguard可以解决此问题。

-keepclassmembers class * implements android.os.Parcelable {
    static ** CREATOR;
}

10-08 18:02