Code example for Spinner

Methods: getSelectedItemPosition

0
        final SavedState myState = new SavedState(superState);
        if (mEnabledCheckbox != null) {
            myState.mEnabled = mEnabledCheckbox.isChecked();
        } 
        if (mInterval != null) {
            myState.mIntervalSelection = mInterval.getSelectedItemPosition();
        } 
        return myState;
    } 
 
    @Override 
    protected void onRestoreInstanceState(Parcelable state) {
        if (state == null || !state.getClass().equals(SavedState.class)) {
            // Didn't save state for us in onSaveInstanceState 
            super.onRestoreInstanceState(state);
            return; 
        } 
 
        SavedState myState = (SavedState) state;
        super.onRestoreInstanceState(myState.getSuperState());
        if (mEnabledCheckbox != null) {