Code example for ListPreference

Methods: setEntriessetEntryValuessetSummarysetValuesetEnabled

0
	public static void PopulateList(Preference preference, String[] List) {
		ListPreference PrefList = (ListPreference)preference;
		if (List == null) {
			PrefList.setEnabled(false);
		} else { 
			PrefList.setEntryValues(List); 
			PrefList.setEntries(List);
			PrefList.setEnabled(true);
		} 
	} 
 
	// 
	// fill filesystem lists with files from array of strings[] 
	// 
	public static void PopulateFSList(Preference preference, String[] List, String filesystem) {
		PopulateList(preference, List);
		ListPreference PrefList = (ListPreference)preference;
		if (filesystem != null) {
			String currentfs = GetCurrentFileSystem(filesystem);
			PrefList.setSummary("current filesystem: " +  currentfs);
			PrefList.setValue(currentfs);
		} else { 
			PrefList.setValue("");
		} 
	} 
 
	// 
	// run command as 'root' 
Experience pair programming with AI  Get Codota for Java