调用onSaveInstanceState而不调用super.onSaveInstanceState(outState)

时间:2013-01-11 13:01:31

标签: java android

如果我将使用此代码而不调用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);
    }

可能会出现什么问题?

1 个答案:

答案 0 :(得分:7)

活动本身会保存包中的一些值,例如片段的状态,如果不调用super方法,则不会保存这些值。