Code example for ListPreference

Methods: getEntry, setSummary

0
        e.setOnPreferenceChangeListener(this);
        updateListPreferenceSummary((ListPreference) e);
    } 
 
    void updateListPreferenceSummary(ListPreference e) {
        e.setSummary(e.getEntry());
    } 
 
    /* 
     * We need to set the PreferenceScreen state in onResume(), as the number of 
     * origins with active features (WebStorage, Geolocation etc) could have 
     * changed after calling the WebsiteSettingsActivity. 
     */ 
    @Override 
    public void onResume() { 
        super.onResume(); 
        final PreferenceScreen websiteSettings = (PreferenceScreen) findPreference(
                PreferenceKeys.PREF_WEBSITE_SETTINGS); 
        websiteSettings.setEnabled(false);
        WebStorage.getInstance().getOrigins(new ValueCallback<Map>() {
            @Override