Code example for ListPreference

Methods: setValueIndex

0
        } 
    } 
 
    public void readEndButtonPreference(ListPreference pref) {
        try { 
            pref.setValueIndex(Settings.System.getInt(getContentResolver(),
                    Settings.System.END_BUTTON_BEHAVIOR));
        } catch (SettingNotFoundException e) {
        } 
    } 
 
    public void readCompCachePreference(ListPreference pref) {
        int val;
        int i;
        if(SystemProperties.get("status.zram.device.exists","0") 
                           .equals("0")){ 
            try{ 
                getPreferenceScreen().removePreference(pref);
                return; 
            } catch (Exception e) {
            }