包裹解组未知类型

时间:2016-03-07 08:05:40

标签: android parcelable parcel

所以我完全被这个错误所困扰,因为我没有使用任何包裹对象,所以它与其他问题不同。非常感谢任何领导,因为我甚至不知道从哪里开始,因为它没有指向我的代码中的任何类或方法或行。

Fatal Exception: java.lang.RuntimeException
Unable to start activity ComponentInfo{com.blueinklabs.investifystocks.free/com.blueinklabs.investifystocks.MainActivity}: java.lang.RuntimeException: Parcel android.os.Parcel@3b18145e: Unmarshalling unknown type code 3801188 at offset 3396
 raw
android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2658)
android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:2723)
android.app.ActivityThread.access$900 (ActivityThread.java:172)
android.app.ActivityThread$H.handleMessage (ActivityThread.java:1422)
android.os.Handler.dispatchMessage (Handler.java:102)
android.os.Looper.loop (Looper.java:145)
android.app.ActivityThread.main (ActivityThread.java:5832)
java.lang.reflect.Method.invoke (Method.java)
java.lang.reflect.Method.invoke (Method.java:372)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1399)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1194)

(续):

Caused by java.lang.RuntimeException
android.os.Parcel.readValue (Parcel.java:2222)
android.os.Parcel.readArrayMapInternal (Parcel.java:2479)
android.os.BaseBundle.unparcel (BaseBundle.java:221)
android.os.Bundle.getSparseParcelableArray (Bundle.java:871)
com.android.internal.policy.impl.PhoneWindow.restoreHierarchyState (PhoneWindow.java:2156)
android.app.Activity.onRestoreInstanceState (Activity.java:1082)
android.app.Activity.performRestoreInstanceState (Activity.java:1027)
android.app.Instrumentation.callActivityOnRestoreInstanceState (Instrumentation.java:1175)
android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2631)
android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:2723)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1194)

编辑: 1)IAB有以下广播接收器:

 mBroadcastReceiver = new IabBroadcastReceiver(MainActivity.this);
 IntentFilter broadcastFilter = new IntentFilter(IabBroadcastReceiver.ACTION);
 registerReceiver(mBroadcastReceiver, broadcastFilter);

2)我最近为他们的Crashlytics库添加了Fabric.io(我通过Crashlytics报告了错误,所以可能是我之前遇到过错误但未在Google Play崩溃中报告)

3)以下是我从Alarms接收意图的方法。但是我一整天都看到错误,而不一定是在触发这些意图的时候。

@Override
    protected void onNewIntent(Intent intent) {
        super.onNewIntent(intent);
    //Log.e("THIS", "IS RUNNING");
    NotificationManager notifManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
    notifManager.cancelAll();

    String myString = intent.getStringExtra(EXTRA_WHICH);
    if (myString != null) {
        if (myString.equals("MORNING")) {
            //Log.e("HEY", "FROM MORNING NOTI");
            String settingsString = intent.getStringExtra(EXTRA_SETTINGS);
            if (settingsString != null) {
                if (settingsString.equals("YES")) {
                    Intent newIntent = new Intent(MainActivity.this, SettingsActivity.class);
                    startActivity(newIntent);
                }
            }

        } else {
            //Log.e("HEY", "FROM EVENING NOTI");
            String settingsString = intent.getStringExtra(EXTRA_SETTINGS);
            if (settingsString != null) {
                if (settingsString.equals("YES")) {
                    Intent newIntent = new Intent(MainActivity.this, SettingsActivity.class);
                    startActivity(newIntent);
                }
            } else {
                String myStringMovers = intent.getStringExtra(EXTRA_MOVERS);
                //Log.e("HEY", myStringMovers);
                if (myStringMovers.equals("YES")) {
                    myViewPager.setCurrentItem(1);
                    Intent newIntent = new Intent(MainActivity.this, IndexDetailActivity.class);
                    newIntent.putExtra(IndexDetailActivity.EXTRA_NAME, "KSE100");
                    newIntent.putExtra(IndexDetailActivity.EXTRA_FULLNAME, "KSE 100 INDEX");
                    startActivityForResult(newIntent, 111);
                } else {
                    myViewPager.setCurrentItem(1);
                }
            }
        }
    }
}

2 个答案:

答案 0 :(得分:1)

我通过此解决方法修复,不实现回调。

@Override
protected void onSaveInstanceState(Bundle outState) {}

@Override
protected void onRestoreInstanceState(Bundle savedInstanceState) {}

答案 1 :(得分:0)

所以我认为这是一个可能由于最新的Android设计支持库23.2.0而发生的问题。

请在此处查看相关代码问题:

https://code.google.com/p/android/issues/detail?id=201836