@Override protected void onRestoreInstanceState(Parcelable state) { SavedLevels levelsState = (SavedLevels) state; levels = levelsState.levels; initialLevels = levelsState.initialLevels; super.onRestoreInstanceState(levelsState.getSuperState()); }
@Override protected Parcelable onSaveInstanceState() { Parcelable superState = super.onSaveInstanceState(); SavedLevels savedLevels = new SavedLevels(superState); savedLevels.levels = levels; savedLevels.initialLevels = initialLevels; return savedLevels; }