private String summarizeBackupScheduleSettings(boolean isEnabled) { if (!isEnabled) { return null; } final StringBuilder summary = new StringBuilder(); final ListPreference regSchedule = (ListPreference) findPreference(REGULAR_TIMEOUT_SECONDS.key); final ListPreference incomingSchedule = (ListPreference) findPreference(INCOMING_TIMEOUT_SECONDS.key); // values are out-of sync regSchedule.setValue(String.valueOf(preferences.getRegularTimeoutSecs())); incomingSchedule.setValue(String.valueOf(preferences.getIncomingTimeoutSecs())); summary.append(regSchedule.getTitle()) .append(": ") .append(regSchedule.getEntry()) .append(", ") .append(incomingSchedule.getTitle()) .append(": ") .append(incomingSchedule.getEntry()); if (preferences.isWifiOnly()) { summary.append(" (") .append(findPreference(WIFI_ONLY.key).getTitle()) .append(")"); } return summary.toString(); }
@Override public void setValue(String value) { super.setValue(value); syncSummary(); }
@Override public void setValue(String value) { super.setValue(value); syncSummary(); }
@Override public void setValue(final String value) { super.setValue(value); notifyChanged(); }
@Override public void setValue(String value) { super.setValue(value); syncSummary(); }
@Override public boolean onPreferenceChange(Preference preference, Object newValue) { listPreference.setValue(newValue.toString()); preference.setSummary(listPreference.getEntry().toString()); if (activity != null) { final Intent intent = activity.getIntent(); activity.finish(); activity.startActivity(intent); } return true; } });
public void onClick(DialogInterface dialog, int id) { SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(getContext()); SharedPreferences.Editor editor1 = settings.edit(); editor1.putString("prefKMLAltitudeMode", "0"); editor1.commit(); ListPreference pKMLAltitudeMode = (ListPreference) findPreference("prefKMLAltitudeMode"); pKMLAltitudeMode.setValue("0"); pKMLAltitudeMode.setSummary(R.string.pref_KML_altitude_mode_absolute); } });
private void updateViews() { mCaptchaHideOnLocked.setChecked(mSettings.isCaptchaHideOnLocked()); mCaptchaOverrideDefaultAction.setChecked(mSettings.isCaptchaOverrideDefaultAction()); mCaptchaPostCopyAction.setValue(String.valueOf(mSettings.getCaptchaPostCopyAction())); mCaptchaIdentifyPattern.setText(mSettings.getCaptchaIdentifyPattern()); mCaptchaParsePattern.setText(mSettings.getCaptchaParsePattern()); mSubscribeIdentityPattern.setText(mSettings.getSubscribeIdentifyPattern()); if ( Build.VERSION.SDK_INT < Build.VERSION_CODES.O ) ((ListPreference)mSubscribePriority).setValue(String.valueOf(mSettings.getSubscribePriority())); getPreferenceScreen().setEnabled(true); }
value[i] = Tools.getprop(Constants.props[i]); if (value[i] == null || value[i].isEmpty()) { props[i].setValue(""); summary = getString(R.string.unknown); props[i].setSummary(summary); props[i].setIcon(R.drawable.interrogation); } else { props[i].setValue(value[i]); summary = value[i]; props[i].setSummary(summary);