Java Code Examples for android.preference.ListPreference#setSummary()
The following examples show how to use
android.preference.ListPreference#setSummary() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SettingFragment.java From BetterWay with Apache License 2.0 | 6 votes |
@Override public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); addPreferencesFromResource(R.xml.preferences); useDefault = (SwitchPreference) findPreference("use_default_image"); useLocal = (SwitchPreference) findPreference("use_local_image"); useOnline = (SwitchPreference) findPreference("update_image_online"); imageLocation = findPreference("local_image_location"); warnDuration = (ListPreference) findPreference("warning_time"); updateDuration = (ListPreference) findPreference("update_duration"); useDefault.setOnPreferenceClickListener(this); useLocal.setOnPreferenceClickListener(this); useOnline.setOnPreferenceClickListener(this); imageLocation.setOnPreferenceClickListener(this); warnDuration.setOnPreferenceChangeListener(this); updateDuration.setOnPreferenceChangeListener(this); warnDuration.setSummary(warnDuration.getEntry()); updateDuration.setSummary(updateDuration.getEntry()); SettingFragmentComponent settingFragmentComponent = DaggerSettingFragmentComponent.builder() .settingFragmentModule(new SettingFragmentModule(this)) .build(); settingFragmentComponent.inject(this); mSettingPresenterImpel = settingFragmentComponent.getSettingPresenterImpel(); initData(); }
Example 2
Source File: SettingFragment.java From SmileEssence with MIT License | 6 votes |
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); addPreferencesFromResource(R.xml.setting); EditTextPreference textSizePreference = (EditTextPreference) findPreference(R.string.key_setting_text_size); textSizePreference.setSummary(textSizePreference.getText()); textSizePreference.setOnPreferenceChangeListener(this); ListPreference themePreference = (ListPreference) findPreference(R.string.key_setting_theme); themePreference.setSummary(themePreference.getEntry()); themePreference.setOnPreferenceChangeListener(this); ListPreference namestylePreference = (ListPreference) findPreference(R.string.key_setting_namestyle); namestylePreference.setSummary(namestylePreference.getEntry()); EditTextPreference timelinesPreference = (EditTextPreference) findPreference(R.string.key_setting_timelines); timelinesPreference.setSummary(String.format(getString(R.string.setting_timelines_summary_format), timelinesPreference.getText())); timelinesPreference.setOnPreferenceChangeListener(this); Preference appInfoPreference = findPreference(R.string.key_setting_application_information); appInfoPreference.setOnPreferenceClickListener(this); Preference clearAccount = findPreference(R.string.key_setting_clear_account); clearAccount.setOnPreferenceClickListener(this); Preference license = findPreference(R.string.key_setting_licenses); license.setOnPreferenceClickListener(this); Preference clearConsumer = findPreference(R.string.key_setting_clear_consumer); clearConsumer.setOnPreferenceClickListener(this); appPreferenceHelper = new AppPreferenceHelper(this.getActivity()); }
Example 3
Source File: KeyguardSettings.java From HeadsUp with GNU General Public License v2.0 | 6 votes |
@Override public void updateSummary(@NonNull Preference preference, @NonNull Config.Option option, @NonNull Object value) { String theme = (String) value; ListPreference cbp = (ListPreference) preference; CharSequence[] themes = cbp.getEntryValues(); for (int i = 0; i < themes.length; i++) { if (TextUtils.equals(theme, themes[i])) { cbp.setSummary(getString( R.string.settings_theme_summary, cbp.getEntries()[i])); break; } } }
Example 4
Source File: SettingsActivity.java From al-muazzin with GNU Lesser General Public License v2.1 | 6 votes |
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Activity activity = getActivity(); sLocaleManager = LocaleManager.getInstance(activity, false); addPreferencesFromResource(R.xml.settings); PreferenceScreen root = getPreferenceScreen(); // System time zone Preference timezonePref = root.findPreference("key_time_zone"); timezonePref.setSummary(getGmtOffSet(activity)); // Language settings ListPreference languagePref = (ListPreference) root.findPreference("key_locale"); languagePref.setEntryValues(LocaleManager.LOCALES); languagePref.setValueIndex(sLocaleManager.getLanguageIndex()); languagePref.setSummary(languagePref.getEntry()); languagePref.setOnPreferenceChangeListener(this); }
Example 5
Source File: SettingsFragment.java From Linphone4Android with GNU General Public License v3.0 | 5 votes |
private void initializePreferredVideoSizePreferences(ListPreference pref) { List<CharSequence> entries = new ArrayList<CharSequence>(); List<CharSequence> values = new ArrayList<CharSequence>(); for (String name : LinphoneManager.getLc().getSupportedVideoSizes()) { entries.add(name); values.add(name); } setListPreferenceValues(pref, entries, values); String value = mPrefs.getPreferredVideoSize(); pref.setSummary(value); pref.setValue(value); }
Example 6
Source File: DialerPreferencesActivity.java From emerald-dialer with GNU General Public License v3.0 | 5 votes |
@Override public void onSharedPreferenceChanged(SharedPreferences prefs, String key) { Preference pref = findPreference(key); if (pref instanceof ListPreference) { ListPreference listPreference = (ListPreference) pref; listPreference.setSummary(listPreference.getEntry()); } if ("theme".equals(key) || "t9_locale".equals(key)) { restartTriggered = true; } }
Example 7
Source File: CameraSettingsActivity.java From Camera2 with Apache License 2.0 | 5 votes |
/** * Sets the summary for the given list preference. * * @param selectedQualities The selected video qualities. * @param preference The preference for which to set the summary. */ private void setSummaryForSelection(SelectedVideoQualities selectedQualities, ListPreference preference) { if (selectedQualities == null) { return; } int selectedQuality = selectedQualities.getFromSetting(preference.getValue()); preference.setSummary(mCamcorderProfileNames[selectedQuality]); }
Example 8
Source File: CameraSettingsActivity.java From Camera2 with Apache License 2.0 | 5 votes |
/** * Set the summary for the given preference. The given preference needs * to be a {@link ListPreference}. */ private void setSummary(Preference preference) { if (!(preference instanceof ListPreference)) { return; } ListPreference listPreference = (ListPreference) preference; if (listPreference.getKey().equals(Keys.KEY_PICTURE_SIZE_BACK)) { setSummaryForSelection(mPictureSizes.backCameraSizes, listPreference); } else if (listPreference.getKey().equals(Keys.KEY_PICTURE_SIZE_FRONT)) { setSummaryForSelection(mPictureSizes.frontCameraSizes, listPreference); } else if (listPreference.getKey().equals(Keys.KEY_VIDEO_QUALITY_BACK)) { setSummaryForSelection(mPictureSizes.videoQualitiesBack.orNull(), listPreference); } else if (listPreference.getKey().equals(Keys.KEY_VIDEO_QUALITY_FRONT)) { setSummaryForSelection(mPictureSizes.videoQualitiesFront.orNull(), listPreference); } else { listPreference.setSummary(listPreference.getEntry()); } }
Example 9
Source File: WidgetActivity.java From Torch with GNU General Public License v3.0 | 5 votes |
@SuppressWarnings("deprecation") // No need to go to fragments right now public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mActivity = this; mContext = this.getApplicationContext(); mPreferences = PreferenceManager.getDefaultSharedPreferences(this); addPreferencesFromResource(R.layout.activity_widget); mWidgetProvider = TorchWidgetProvider.getInstance(); mColor = (ListPreference) findPreference(KEY_WIDGET_COLOR); if(mColor.getValue()==null){ mColor.setValueIndex(0); } mColor.setSummary(mColor.getValue().toString()); mColor.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { @Override public boolean onPreferenceChange(Preference preference, Object newValue) { preference.setSummary(newValue.toString()); String mPrefColor = newValue.toString(); Utils.colorizeBar(mActivity, mContext, mPrefColor); return true; } }); Bundle extras = getIntent().getExtras(); if (extras != null) { mAppWidgetId = extras.getInt(AppWidgetManager.EXTRA_APPWIDGET_ID, AppWidgetManager.INVALID_APPWIDGET_ID); } mPreferences.registerOnSharedPreferenceChangeListener(this); }
Example 10
Source File: SettingsFragment.java From Linphone4Android with GNU General Public License v3.0 | 5 votes |
private void initLimeEncryptionPreference(ListPreference pref) { List<CharSequence> entries = new ArrayList<CharSequence>(); List<CharSequence> values = new ArrayList<CharSequence>(); entries.add(getString(R.string.lime_encryption_entry_disabled)); values.add(LinphoneLimeState.Disabled.toString()); LinphoneCore lc = LinphoneManager.getLcIfManagerNotDestroyedOrNull(); if (lc == null || !lc.isLimeEncryptionAvailable()) { setListPreferenceValues(pref, entries, values); pref.setEnabled(false); return; } entries.add(getString(R.string.lime_encryption_entry_mandatory)); values.add(LinphoneLimeState.Mandatory.toString()); entries.add(getString(R.string.lime_encryption_entry_preferred)); values.add(LinphoneLimeState.Preferred.toString()); setListPreferenceValues(pref, entries, values); LinphoneLimeState lime = mPrefs.getLimeEncryption(); if (lime == LinphoneLimeState.Disabled) { pref.setSummary(getString(R.string.lime_encryption_entry_disabled)); } else if (lime == LinphoneLimeState.Mandatory) { pref.setSummary(getString(R.string.lime_encryption_entry_mandatory)); } else if (lime == LinphoneLimeState.Preferred) { pref.setSummary(getString(R.string.lime_encryption_entry_preferred)); } pref.setValue(lime.toString()); }
Example 11
Source File: Settings.java From SMP with GNU General Public License v3.0 | 5 votes |
private void setFoldSummary() { int idx = params.getDefaultFold(); ListPreference prefFold = (ListPreference) findPreference(PrefKeys.DEFAULT_FOLD.name()); String[] foldEntries = getResources().getStringArray(R.array.settings_fold_entries); if (idx >= foldEntries.length) idx = foldEntries.length - 1; if (idx >= 0) prefFold.setSummary(foldEntries[idx]); }
Example 12
Source File: SettingsShortcutActivity.java From JotaTextEditor with Apache License 2.0 | 5 votes |
private void setSummary() { int prlen = mPs.getPreferenceCount(); for( int i=0;i<prlen ;i++ ){ Preference pr = mPs.getPreference(i); if ( pr instanceof ListPreference ){ ListPreference lpr = (ListPreference)pr; lpr.setSummary(lpr.getEntry()); } } }
Example 13
Source File: OthersPreferenceFragment.java From SkyTube with GNU General Public License v3.0 | 5 votes |
@Override public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) { if(key != null) { if (key.equals(getString(R.string.pref_key_default_tab_name))) { // If the user changed the Default Tab Preference, update the summary to show the new default tab ListPreference defaultTabPref = (ListPreference) findPreference(key); defaultTabPref.setSummary(String.format(getString(R.string.pref_summary_default_tab), defaultTabPref.getEntry())); } else if (key.equals(getString(R.string.pref_key_hide_tabs))) { displayRestartDialog(R.string.pref_hide_tabs_restart, true); } else if (key.equals(getString(R.string.pref_youtube_api_key))) { // Validate the entered API Key when saved (and not empty), with a simple call to get the most popular video EditTextPreference youtubeAPIKeyPref = (EditTextPreference) findPreference(getString(R.string.pref_youtube_api_key)); String youtubeAPIKey = youtubeAPIKeyPref.getText(); if (youtubeAPIKey != null) { youtubeAPIKey = youtubeAPIKey.trim(); if (!youtubeAPIKey.isEmpty()) { // validate the user's API key new ValidateYouTubeAPIKeyTask(youtubeAPIKey).executeInParallel(); } else { // inform the user that we are going to use the default YouTube API key and // that we need to restart the app displayRestartDialog(R.string.pref_youtube_api_key_default,false); } } } else if (key.equals(getString(R.string.pref_key_subscriptions_alphabetical_order))) { SubsAdapter subsAdapter = SubsAdapter.get(getActivity()); subsAdapter.refreshSubsList(); }/*else if (key.equals(getString(R.string.pref_feed_notification_key))) { ListPreference feedNotificationPref = (ListPreference) findPreference(key); feedNotificationPref.setSummary(String.format(getString(R.string.pref_summary_feed_notification), feedNotificationPref.getEntry())); int interval = Integer.parseInt(feedNotificationPref.getValue()); SkyTubeApp.setFeedUpdateInterval(interval); }*/ } }
Example 14
Source File: DesktopModeFragment.java From Taskbar with Apache License 2.0 | 4 votes |
private void updateAdditionalSettings(boolean desktopModeEnabled) { finishedLoadingPrefs = false; boolean enabled = desktopModeEnabled && U.hasWriteSecureSettingsPermission(getActivity()) && U.isDesktopModeActive(getActivity()); findPreference(PREF_DISPLAY_DENSITY).setEnabled(enabled); if(U.isShowHideNavbarSupported()) { findPreference(PREF_AUTO_HIDE_NAVBAR_DESKTOP_MODE).setEnabled(enabled); findPreference(PREF_AUTO_HIDE_NAVBAR_DESKTOP_MODE).setOnPreferenceClickListener(this); } SharedPreferences pref = U.getSharedPreferences(getActivity()); DisplayInfo info = U.getExternalDisplayInfo(getActivity()); String densityPrefValue = info.currentDensity == info.defaultDensity ? "reset" : Integer.toString(info.currentDensity); pref.edit().putString(PREF_DISPLAY_DENSITY, densityPrefValue).apply(); String[] noDefaultList = getResources().getStringArray(R.array.tb_pref_display_density_list_alt); String[] noDefaultValues = getResources().getStringArray(R.array.tb_pref_display_density_list_values_alt); boolean useNoDefault = false; for(int i = 0; i < noDefaultValues.length; i++) { if(info.defaultDensity == Integer.parseInt(noDefaultValues[i])) { noDefaultList[i] = getString(R.string.tb_density_default, info.defaultDensity); noDefaultValues[i] = "reset"; useNoDefault = true; break; } } ListPreference densityPref = ((ListPreference) findPreference(PREF_DISPLAY_DENSITY)); if(useNoDefault) { densityPref.setEntries(noDefaultList); densityPref.setEntryValues(noDefaultValues); } else { densityPref.setEntries(R.array.tb_pref_display_density_list); densityPref.setEntryValues(R.array.tb_pref_display_density_list_values); } densityPref.setValue(densityPrefValue); bindPreferenceSummaryToValue(densityPref); if(densityPref.getSummary() == null || densityPref.getSummary().equals("")) densityPref.setSummary(getString(R.string.tb_density_custom, info.currentDensity)); finishedLoadingPrefs = true; }
Example 15
Source File: PGPClipperSettingsActivity.java From PGPClipper with Apache License 2.0 | 4 votes |
@Override protected void onResume() { super.onResume(); final ListPreference themePref = (ListPreference) fragment.findPreference("themeSelection"); final SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); final CheckBoxPreference fingerprintCheckboxPreference = (CheckBoxPreference) fragment.findPreference("enableFingerprintAuth"); final CheckBoxPreference pgpClipperEnabledCheckbox = (CheckBoxPreference) fragment.findPreference("pgpClipperEnabledCheckbox"); themePref.setEntryValues(R.array.themes_values); themePref.setEntries(R.array.themes); String currentVal = sharedPreferences.getString("themeSelection", "dark"); if (currentVal != null) { switch (currentVal) { case "dark": themePref.setSummary(getResources().getString(R.string.darkText)); break; case "light": themePref.setSummary(getResources().getString(R.string.lightText)); break; } } String providerApp = sharedPreferences.getString("pgpServiceProviderApp", null); if (providerApp == null || "".equals(providerApp)) { pgpClipperEnabledCheckbox.setEnabled(false); pgpClipperEnabledCheckbox.setChecked(false); stopService(new Intent(PGPClipperSettingsActivity.this, PGPClipperService.class)); } else { if (pgpClipperEnabledCheckbox.isChecked()) { startService(new Intent(PGPClipperSettingsActivity.this, PGPClipperService.class)); } pgpClipperEnabledCheckbox.setEnabled(true); } if (android.os.Build.VERSION.SDK_INT < Build.VERSION_CODES.M) // Fingerprint API not supported below M fingerprintCheckboxPreference.setEnabled(false); else { fingerprintCheckboxPreference.setEnabled(true); } }
Example 16
Source File: SettingsPage.java From fanfouapp-opensource with Apache License 2.0 | 4 votes |
@Override protected void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); CommonHelper.initScreenConfig(this); addPreferencesFromResource(R.xml.options); final ListPreference interval = (ListPreference) findPreference(getText(R.string.option_notification_interval)); interval.setSummary(interval.getEntry()); final Preference currentAccount = findPreference(getText(R.string.option_current_account)); currentAccount.setSummary("" + AppContext.getUserName() + "(" + AppContext.getUserId() + ")"); final Preference checkUpdate = findPreference(getText(R.string.option_check_update)); checkUpdate.setOnPreferenceClickListener(this); getPreferenceScreen().getSharedPreferences() .registerOnSharedPreferenceChangeListener(this); }
Example 17
Source File: GeneralPreferenceFragment.java From V2EX with GNU General Public License v3.0 | 4 votes |
@Override public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); getPreferenceManager().setSharedPreferencesName( Config.getConfig(ConfigRefEnum.CONFIG_PREFERENCE_SETTING_FILE)); addPreferencesFromResource(R.xml.pref_general); ListPreference themePreference = (ListPreference) findPreference( getString(R.string.key_theme)); themePreference.setSummary(Config.getConfig(ConfigRefEnum.CONFIG_THEME)); ListPreference dateFormatPreference = (ListPreference)findPreference( getString(R.string.key_date_format)); String[] dateEntries = new String[dateFormatPreference.getEntryValues().length]; int i = 0; for (CharSequence s:dateFormatPreference.getEntryValues()){ String date = TimeUtil.getDateNow(String.valueOf(s)); dateEntries[i++] = date; } dateFormatPreference.setEntries(dateEntries); dateFormatPreference.setSummary(TimeUtil.getDateNow(Config.getConfig( ConfigRefEnum.CONFIG_DATE_FORMAT))); ListPreference localePreference = (ListPreference) findPreference(getString(R.string.key_local)); String[] localesEntryValue = new String[Config.LOCAL_LIST.size()]; String[] localesEntries= new String[Config.LOCAL_LIST.size()]; int index = 0; for (Locale locale:Config.LOCAL_LIST){ localesEntryValue[index] = locale.toString(); localesEntries[index++] = locale.getDisplayCountry(); } localePreference.setDefaultValue(localesEntryValue[0]); localePreference.setEntryValues(localesEntryValue); localePreference.setEntries(localesEntries); Preference clearCachePreference = findPreference(getString(R.string.clear_cache)); clearCachePreference.setOnPreferenceClickListener(this::clearCache); clearCachePreference.setSummary("缓存大小 12 MB"); findPreference(getString(R.string.key_home_tabs)).setOnPreferenceClickListener(preference -> { CustomTabActivity.start(getActivity()); return false; }); }
Example 18
Source File: AlarmCreationFragment.java From boilr with GNU General Public License v3.0 | 4 votes |
@Override public boolean onPreferenceChange(Preference preference, Object newValue) { String key = preference.getKey(); if(key.equals(PREF_KEY_EXCHANGE)) { ListPreference listPref = (ListPreference) preference; mExchangeIndex = listPref.findIndexOfValue((String) newValue); String exchangeName = (String) listPref.getEntries()[mExchangeIndex]; listPref.setSummary(exchangeName); mPairIndex = 0; updatePairsList((String) newValue, exchangeName, null); } else if(key.equals(PREF_KEY_PAIR)) { mPairIndex = Integer.parseInt((String) newValue); preference.setSummary(mPairs.get(mPairIndex).toString()); updateDependentOnPairAux(); } else if(key.equals(PREF_KEY_TYPE)) { Fragment creationFrag; Bundle args = new Bundle(); args.putInt("exchangeIndex", mExchangeIndex); args.putInt("pairIndex", mPairIndex); args.putString("alertType", mAlarmAlertTypePref.getValue()); args.putString("alertSound", mAlertSoundPref.getValue()); args.putString("vibrate", mVibratePref.getValue()); if(newValue.equals(PREF_VALUE_PRICE_CHANGE)) { creationFrag = new PriceChangeAlarmCreationFragment(); } else { // newValue.equals(PREF_VALUE_PRICE_HIT)) creationFrag = new PriceHitAlarmCreationFragment(); } creationFrag.setArguments(args); mEnclosingActivity.getFragmentManager().beginTransaction().replace(android.R.id.content, creationFrag).commit(); } else if(key.equals(PREF_KEY_UPDATE_INTERVAL)) { preference.setSummary(mEnclosingActivity.getString(R.string.seconds_abbreviation, newValue)); } else if(key.equals(PREF_KEY_ALARM_ALERT_TYPE)) { ListPreference alertTypePref = (ListPreference) preference; String alertType = (String) newValue; alertTypePref.setSummary(alertTypePref.getEntries()[alertTypePref.findIndexOfValue(alertType)]); // Change selectable ringtones according to the alert type mAlertSoundPref.setRingtoneType(alertType); mAlertSoundPref.setDefaultValue(); } else if(key.equals(PREF_KEY_ALARM_ALERT_SOUND)) { // Nothing to do. } else if(key.equals(PREF_KEY_ALARM_VIBRATE)) { ListPreference vibratePref = (ListPreference) preference; vibratePref.setSummary(vibratePref.getEntries()[vibratePref.findIndexOfValue((String) newValue)]); } else if(key.equals(PREF_KEY_SNOOZE_ON_RETRACE)) { // Nothing to do. } else { Log.d("No behavior for " + key); } return true; }
Example 19
Source File: SettingsPreferenceFragment.java From screenrecorder with GNU Affero General Public License v3.0 | 4 votes |
@Override public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String s) { Preference pref = findPreference(s); if (pref == null) return; switch (pref.getTitleRes()) { case R.string.preference_resolution_title: updateResolution((ListPreference) pref); break; case R.string.preference_fps_title: String fps = String.valueOf(getValue(getString(R.string.fps_key), "30")); pref.setSummary(fps); break; case R.string.preference_bit_title: float bps = bitsToMb(Integer.parseInt(getValue(getString(R.string.bitrate_key), "7130317"))); pref.setSummary(bps + " Mbps"); break; case R.string.preference_filename_format_title: pref.setSummary(getFileSaveFormat()); break; case R.string.preference_audio_record_title: requestAudioPermission(); break; case R.string.preference_filename_prefix_title: EditTextPreference etp = (EditTextPreference) pref; etp.setSummary(etp.getText()); ListPreference filename = (ListPreference) findPreference(getString(R.string.filename_key)); filename.setSummary(getFileSaveFormat()); break; case R.string.preference_floating_control_title: requestSystemWindowsPermission(); break; case R.string.preference_show_touch_title: CheckBoxPreference showTouchCB = (CheckBoxPreference)pref; if (showTouchCB.isChecked() && !hasPluginInstalled()){ showTouchCB.setChecked(false); showDownloadAlert(); } break; case R.string.preference_crash_reporting_title: CheckBoxPreference crashReporting = (CheckBoxPreference)pref; CheckBoxPreference anonymousStats = (CheckBoxPreference) findPreference(getString(R.string.preference_anonymous_statistics_key)); if(!crashReporting.isChecked()) anonymousStats.setChecked(false); startAnalytics(); break; case R.string.preference_anonymous_statistics_title: startAnalytics(); break; case R.string.preference_theme_title: activity.recreate(); break; } }
Example 20
Source File: SettingsActivity.java From Easycam with BSD 3-Clause "New" or "Revised" License | 3 votes |
private void populateDeviceListPreference(ArrayList<DeviceEntry> validStreamingDeviceList, ListPreference selectDevice) { CharSequence[] entries; CharSequence[] entryValues; if (validStreamingDeviceList.isEmpty()) { Log.i(TAG, "No V4L2 compatible streaming devices found on system"); entries = new CharSequence[1]; entryValues = new CharSequence[1]; entries[0] = "No devices found"; entryValues[0] = "NO_DEVICE"; selectDevice.setSummary(entries[0]); } else { entries = new CharSequence[validStreamingDeviceList.size()]; entryValues = new CharSequence[validStreamingDeviceList.size()]; for (int i = 0; i < validStreamingDeviceList.size(); i++) { entries[i] = validStreamingDeviceList.get(i).deviceDescription; entryValues[i] = validStreamingDeviceList.get(i).deviceName; } } selectDevice.setEntries(entries); selectDevice.setEntryValues(entryValues); }