Code example for SeekBar

Methods: getProgress

0
        final Parcelable superState = super.onSaveInstanceState();
        if (getDialog() == null || !getDialog().isShowing()) return superState;
 
        // Save the dialog state 
        final SavedState myState = new SavedState(superState);
        myState.progress = mSeekBar.getProgress();
        myState.oldSpeed = mOldSpeed;
 
        // Restore the old state when the activity or dialog is being paused 
        restoreOldState(); 
        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; 
        }