Code example for ListPreference

Methods: getValue, setSummary

0
                    break; 
            } 
            lp.setSummary(summary);
 
            lp = (ListPreference) getPreferenceScreen().findPreference("flowcontrol_list");
            switch (Integer.valueOf(lp.getValue())) {
                case 0: 
                    summary = "None";
                    break; 
                case 1: 
                    summary = "Rts/Cts";
                    break; 
                case 2: 
                    summary = "Dtr/Dsr";
                    break; 
                case 3: 
                    summary = "Xon";
                    break; 
                default: 
                    summary = "none";
                    break; 
            } 
            lp.setSummary(summary);
 
            lp = (ListPreference) getPreferenceScreen().findPreference("break_list");
            switch (Integer.valueOf(lp.getValue())) {
                case 0: 
                    summary = "None";