1

我崩潰與下面的崩潰日誌..我不能再現它......任何知道爲什麼它發生的人?包裹錯誤在actionbarsherlock

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.qz.XXXX/com.qz.XXXX.XXXXStartActivity}: java.lang.RuntimeException: Parcel [email protected]: Unmarshalling unknown type code -38 at offset 1124 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2351) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387) 
at android.app.ActivityThread.access$600(ActivityThread.java:151) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1331) 
at android.os.Handler.dispatchMessage(Handler.java:99) 
at android.os.Looper.loop(Looper.java:155) 
at android.app.ActivityThread.main(ActivityThread.java:5485) 
at java.lang.reflect.Method.invokeNative(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:511) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1028) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:795) 
at dalvik.system.NativeStart.main(Native Method) 
Caused by: java.lang.RuntimeException: Parcel [email protected]: Unmarshalling unknown type code -38 at offset 1124 
at android.os.Parcel.readValue(Parcel.java:2037) 
at android.os.Parcel.readSparseArrayInternal(Parcel.java:2260) 
at android.os.Parcel.readSparseArray(Parcel.java:1692) 
at android.os.Parcel.readValue(Parcel.java:2027) 
at android.os.Parcel.readMapInternal(Parcel.java:2231) 
at android.os.Bundle.unparcel(Bundle.java:223) 
at android.os.Bundle.getSparseParcelableArray(Bundle.java:1232) 
at com.android.internal.policy.impl.PhoneWindow.restoreHierarchyState(PhoneWindow.java:1728) 
at android.app.Activity.onRestoreInstanceState(Activity.java:957) 
at com.actionbarsherlock.app.SherlockActivity.onRestoreInstanceState(SherlockActivity.java:127) 
at android.app.Activity.performRestoreInstanceState(Activity.java:929) 
at android.app.Instrumentation.callActivityOnRestoreInstanceState(Instrumentation.java:1162) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2329) 

回答

1

重現步驟:

  1. 啓用開發商選擇 「不保留活動」
  2. 運行應用程序
  3. 啓動其他包活動
  4. 按返回 - >崩潰

我已經修復它:

@Override 
protected void onSaveInstanceState(Bundle outState) { 
    //super.onSaveInstanceState(outState); 
} 

如果您不需要保存活動狀態,這是一個很好的解決方案。