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

onRestoreInstanceState 恢复状态 赋值错误 #2

Open
NQPE opened this issue Dec 16, 2018 · 0 comments
Open

onRestoreInstanceState 恢复状态 赋值错误 #2

NQPE opened this issue Dec 16, 2018 · 0 comments

Comments

@NQPE
Copy link

NQPE commented Dec 16, 2018

@OverRide
protected void onRestoreInstanceState(Parcelable state) {
SavedState savedState = (SavedState) state;
super.onRestoreInstanceState(savedState.getSuperState());
this.displayState = savedState.state;
setDisplayState(this.displayState);
}

其中如果设置了 this.displayState = savedState.state; 再调用 setDisplayState(this.displayState); 等于没有实际作用,不应该提前设置状态值 而是直接调用 setDisplayState(savedState.state;);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant