Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuntimeException: Parcel android.os.Parcel@3d770ee5: Unmarshalling unknown type code 7471204 at offset 2264 #24

Closed
aminelaadhari opened this issue Jul 10, 2015 · 1 comment

Comments

@aminelaadhari
Copy link

@aminelaadhari aminelaadhari commented Jul 10, 2015

There is some issues with view state restoring:

SavedState of BaseRoundCornerProgressBar does not write all the values in write in writeToParcel,
correct code is:

        public void writeToParcel(Parcel out, int flags) {
            super.writeToParcel(out, flags);
            out.writeFloat(this.max);
            out.writeFloat(this.progress);
            out.writeFloat(this.secondaryProgress);

            out.writeInt(this.backgroundWidth);
            out.writeInt(this.backgroundHeight);
            out.writeInt(this.radius);
            out.writeInt(this.padding);
            out.writeInt(this.progressColor);
            out.writeInt(this.secondaryProgressColor);
            out.writeInt(this.backgroundColor);

            out.writeInt(this.layoutBackgroundColor);
            out.writeInt(this.layoutProgress);
            out.writeInt(this.layoutSecondaryProgress);

            out.writeByte((byte) (this.isProgressBarCreated ? 1 : 0));
            out.writeByte((byte) (this.isProgressSetBeforeDraw ? 1 : 0));
            out.writeByte((byte) (this.isMaxProgressSetBeforeDraw ? 1 : 0));
            out.writeByte((byte) (this.isBackgroundColorSetBeforeDraw ? 1 : 0));
            out.writeByte((byte) (this.isProgressColorSetBeforeDraw ? 1 : 0));
            out.writeByte((byte) (this.isScreenMeasure ? 1 : 0));
            out.writeByte((byte) (this.isBackgroundLayourSet ? 1 : 0));
        }

After fixing this issue I am getting other issues with IconRoundCornerProgressBar
Caused by: android.os.BadParcelableException: ClassNotFoundException when unmarshalling: com.ake
xorcist.roundcornerprogressbar.common.BaseRoundCornerProgressBar$SavedState
E at android.os.Parcel.readParcelableCreator(Parcel.java:2289)
E at android.os.Parcel.readParcelable(Parcel.java:2239)
E at android.view.AbsSavedState.(AbsSavedState.java:57)
E at android.view.View$BaseSavedState.(View.java:20038)
E at com.akexorcist.roundcornerprogressbar.IconRoundCornerProgressBar$SavedState.(IconRo
undCornerProgressBar.java:216)
E at com.akexorcist.roundcornerprogressbar.IconRoundCornerProgressBar$SavedState.(IconRo
undCornerProgressBar.java:202)
E at com.akexorcist.roundcornerprogressbar.IconRoundCornerProgressBar$SavedState$1.createFromP
arcel(IconRoundCornerProgressBar.java:240)
E at com.akexorcist.roundcornerprogressbar.IconRoundCornerProgressBar$SavedState$1.createFromP
arcel(IconRoundCornerProgressBar.java:238)
E at android.os.Parcel.readParcelable(Parcel.java:2246)
E at android.os.Parcel.readValue(Parcel.java:2146)
E at android.os.Parcel.readSparseArrayInternal(Parcel.java:2540)
E at android.os.Parcel.readSparseArray(Parcel.java:1868)
E at android.os.Parcel.readValue(Parcel.java:2203)
E at android.os.Parcel.readArrayMapInternal(Parcel.java:2479)
E at android.os.BaseBundle.unparcel(BaseBundle.java:221)
E at android.os.Bundle.getSparseParcelableArray(Bundle.java:871)
E at com.android.internal.policy.impl.PhoneWindow.restoreHierarchyState(PhoneWindow.java:1979)
E at android.app.Activity.onRestoreInstanceState(Activity.java:1022)
E at android.app.Activity.performRestoreInstanceState(Activity.java:977)
E at android.app.Instrumentation.callActivityOnRestoreInstanceState(Instrumentation.java:1161)
E at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2271)

All tested with the sample prject and with don't keep actitivties activated

@scana

This comment has been minimized.

Copy link

@scana scana commented Jul 15, 2015

It has been fixed today with #16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.