@Override protected Parcelable onSaveInstanceState() { // save the instance state so that it will survive screen orientation changes and other events // that may temporarily destroy it final Parcelable superState = super.onSaveInstanceState(); // set the state's value with the class member that holds current setting value final SavedState myState = new SavedState(superState); myState.minValue = getMinValue(); myState.maxValue = getMaxValue(); myState.value = getValue(); return myState; }