如果我将在不调用super.onSaveInstanceState(outState);的情况下使用此代码;
@Override protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
outState.putLong(ID, mId);
}
像这样:
@Override protected void onSaveInstanceState(Bundle outState) {
outState.putLong(ID, mId);
}
有什么问题吗?
最佳答案
Activity 本身会将某些值保存在bundle中,例如Fragments的状态,如果您不调用super方法,则这些值将不会保存。
关于java - 调用onSaveInstanceState而不调用super.onSaveInstanceState(outState),我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/14278763/