Code example for ListPreference

Methods: setEntriessetEntryValuessetSummary

	private void buildListPreference(String key, SharedPreferences settings, String defaultVal, String[] entries, String[] entryValues) {
		if (entryValues == null)
			entryValues = entries;
		ListPreference lp = (ListPreference) findPreference(key);
		lp.setSummary(settings.getString(key, defaultVal));
		// Sets the human-readable entries to be shown in the list. 
		// The array to find the value to save for a preference when an entry 
		// from entries is selected. 
	 * Update the summary fields of each pref with the actual value see: 
	 * http://stackoverflow 
	 * .com/questions/3827356/setting-ui-preference-summary-field 
	 * -to-the-value-of-the-preference 
Stop searching for code, let great code find you!  Add Codota to your java IDE