Code example for ListPreference

Methods: getEntrysetSummarysetValuesetOnPreferenceChangeListener

     * @param value Initial value for the {@link ListPreference} object. 
     * @return The {@link ListPreference} instance identified by {@code key}. 
    protected ListPreference setupListPreference(final String key, final String value) {
        final ListPreference prefView = (ListPreference) findPreference(key);
        prefView.setOnPreferenceChangeListener(new PreferenceChangeListener(prefView));
        return prefView;
     * Initialize a given {@link ListPreference} instance. 
     * @param prefView    The {@link ListPreference} instance to initialize. 
     * @param value       Initial value for the {@link ListPreference} object. 
     * @param entries     Sets the human-readable entries to be shown in the list. 
     * @param entryValues The array to find the value to save for a preference when an 
     *                    entry from entries is selected.