find a error issue

it happened when onSaveInstanceState is excuted.
Process: com.yds.cameratest2, PID: 28978
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.yds.cameratest2/camera.CameraActivity}: android.os.BadParcelableException: ClassNotFoundException when unmarshalling: ��������������
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2665)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Caused by: android.os.BadParcelableException: ClassNotFoundException when unmarshalling: ��������������
at android.os.Parcel.readParcelableCreator(Parcel.java:2536)
at android.os.Parcel.readParcelable(Parcel.java:2462)
at android.view.AbsSavedState.
Hi, @wang727955603!
Thank you for using our library. We will investigate this issue and fix it as soon as possible. If you can provide your xml and java code of using our library - it can help us.
With best regards, Cleveroad team.
@ValeryGes I send a email to [email protected], you can check it.
@wang727955603, resend please it to [email protected] (with email subject: "LoopBar. Support request."). [email protected] - is not for replying.
@ValeryGes ok
@ValeryGes I solved this problem。change some code in LoopBarView.java like this: public static class SavedState extends BaseSavedState {
public static final Parcelable.Creator<SavedState> CREATOR = new Parcelable.Creator<SavedState>() {
public SavedState createFromParcel(Parcel in) {
return new SavedState(in);
}
public SavedState[] newArray(int size) {
return new SavedState[size];
}
};
private int mCurrentItemPosition;
@GravityAttr
private int mSelectionGravity;
@ScrollAttr
private int mScrollMode;
private boolean mIsInfinite;
private int mAdapterSize;
public SavedState(Parcelable superState) {
super(superState);
}
@SuppressWarnings("unused")
private SavedState(Parcel parcel) {
super(parcel);
mCurrentItemPosition = parcel.readInt();
@GravityAttr
int gravity = parcel.readInt();
mSelectionGravity = gravity;
@ScrollAttr
int scrollMode = parcel.readInt();
mScrollMode = scrollMode;
boolean[] booleanValues = new boolean[1];
parcel.readBooleanArray(booleanValues);
mIsInfinite = booleanValues[0];
mAdapterSize = parcel.readInt();
}
SavedState(Parcelable superState, int currentItemPosition,
int selectionGravity, boolean isInfinite, int scrollMode, int adapterSize) {
super(superState);
mCurrentItemPosition = currentItemPosition;
mSelectionGravity = selectionGravity;
mIsInfinite = isInfinite;
mScrollMode = scrollMode;
mAdapterSize = adapterSize;
}
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel parcel, int flags) {
super.writeToParcel(parcel,flags);
parcel.writeInt(mCurrentItemPosition);
parcel.writeInt(mSelectionGravity);
parcel.writeInt(mScrollMode);
parcel.writeBooleanArray(new boolean[]{mIsInfinite});
parcel.writeInt(mAdapterSize);
}
}
same error happend to me
@YesilHilalYazilim the last item like i said, i solved this problem, did it not work for you?
Actually, I didnt face to face with this error... I have live app. My user getting this error a lot... I released patch with your solution waiting result
@YesilHilalYazilim If we put app in the background, its state is onStop or OnPause(to my phone is onStop state), then we open many other apps, increase the usage of memory and CPU. Due to competition for resources, the system will destroy this app, and the app will call the method of onSaveInstanceState() by itself, when we open it again, it will call onRestoreInstanceState(), and this time it will lead to the error.