Code example for SeekBar

Methods: getProgresssetVisibility

0
    	return this.brightness;
    } 
 
    public void setBrightnessMode(int mode) {
        if (mode == Settings.System.SCREEN_BRIGHTNESS_MODE_AUTOMATIC) {
            mSeekBar.setVisibility(View.GONE);
        } else { 
            mSeekBar.setVisibility(View.VISIBLE);
        } 
        this.brightnessMode = mode;
    } 
 
    @Override 
    protected Parcelable onSaveInstanceState() {
        final Parcelable superState = super.onSaveInstanceState();
        if (getDialog() == null || !getDialog().isShowing()) return superState;
 
        // Save the dialog state 
        final SavedState myState = new SavedState(superState);
        myState.automatic = mCheckBox.isChecked();
        myState.progress = mSeekBar.getProgress();
        myState.oldAutomatic = mOldAutomatic == 1;
        myState.oldProgress = mOldBrightness;
 
        // Restore the old state when the activity or dialog is being paused 
        restoreOldState();