Code example for NumberPicker

Methods: getMaxValuegetMinValuegetValue

        // Create instance of custom BaseSavedState 
        final SavedState savedState = new SavedState(superState);
        // Set the state's value with the class member that holds current setting value 
        savedState.value = mNumberPicker.getValue();
        savedState.maxValue = mNumberPicker.getMaxValue();
        savedState.minValue = mNumberPicker.getMinValue();
        return savedState;
    protected void onRestoreInstanceState(Parcelable state) {
        // Check whether we saved the state in onSaveInstanceState 
        if (state == null || !state.getClass().equals(SavedState.class)) {
            // Didn't save the state, so call superclass 
        // Cast state to custom BaseSavedState and pass to superclass