Code example for ListPreference

Methods: getEntry, setSummary, setValue

-2
            ringerMode = AudioManager.RINGER_MODE_SILENT;
        } else if (value.equals(RING_MODE_VIBRATE)) {
            ringerMode = AudioManager.RINGER_MODE_VIBRATE;
        } 
        mAudioManager.setRingerMode(ringerMode);
    } 
 
    private String getPhoneRingModeSettingValue() {
        switch (mAudioManager.getRingerMode()) {
        case AudioManager.RINGER_MODE_NORMAL:
            return RING_MODE_NORMAL;
        case AudioManager.RINGER_MODE_VIBRATE:
            return RING_MODE_VIBRATE;
        case AudioManager.RINGER_MODE_SILENT:
            return RING_MODE_MUTE;
        } 
        // Shouldn't happen 
        return RING_MODE_NORMAL;
    } 
 
    // updateState in fact updates the UI to reflect the system state