We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
大神啊,Parcel 写法不规范,我找了一个上午的问题... 在部分低内存的手机会出现这个情况,可以在开发者选项打开不保留活动模拟低内存 添加describeContents和CREATOR 可以解决问题 完整修改如下:
static final class SavedState extends BaseSavedState { private boolean isOpened; SavedState(Parcelable superState) { super(superState); } private SavedState(Parcel in) { super(in); isOpened = 1 == in.readInt(); } @Override public void writeToParcel(Parcel out, int flags) { super.writeToParcel(out, flags); out.writeInt(isOpened ? 1 : 0); } //必须 @Override public int describeContents() { return 0; } //必须 public static final Creator<SavedState> CREATOR = new Creator<SavedState>() { @Override public SavedState createFromParcel(Parcel in) { return new SavedState(in); } @Override public SavedState[] newArray(int size) { return new SavedState[size]; } }; }
The text was updated successfully, but these errors were encountered:
fixed #9,#10
1f6e652
No branches or pull requests
大神啊,Parcel 写法不规范,我找了一个上午的问题...
在部分低内存的手机会出现这个情况,可以在开发者选项打开不保留活动模拟低内存
添加describeContents和CREATOR 可以解决问题
完整修改如下:
The text was updated successfully, but these errors were encountered: