Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Call onSaveInstanceState without calling super.onSaveInstanceState(outState)

Tags:

java

android

If I will use this code without calling super.onSaveInstanceState(outState);

@Override protected void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putLong(ID, mId);
}

like this:

@Override protected void onSaveInstanceState(Bundle outState) {      
        outState.putLong(ID, mId);
    }

What problems can be?

like image 742
Igor Kostenko Avatar asked Jan 11 '13 13:01

Igor Kostenko


1 Answers

The activity itself saves some of the values in the bundle e.g state of the Fragments, if you do not call the super method, those values will not be saved.

like image 138
nandeesh Avatar answered Oct 21 '22 07:10

nandeesh