Code example for ListPreference

Methods: getValue, setSummary

0
        private void updateSummary() { 
            String summary; 
 
            ListPreference lp = (ListPreference) getPreferenceScreen().findPreference( 
                    "fontsize_list"); 
            lp.setSummary(lp.getValue()); 
 
            lp = (ListPreference) getPreferenceScreen().findPreference("typeface_list"); 
            switch(Integer.valueOf(lp.getValue())) { 
                case 0: 
                    summary = "normal"; 
                    break; 
                case 1: 
                    summary = "sans"; 
                    break; 
                case 2: 
                    summary = "serif"; 
                    break; 
                case 3: 
                    summary = "monospace"; 
                    break;