Is possible to change the summary of EditTextPreference dynamically in Android?
问题 I set up a preferenceScreen to edit the settings in my application. I would like to insert an EditTextPreference that contains a Title like "set your name" and a summary containing the name entered. Is that possible? thank you in advance! 回答1: Sure, here is a short example: EditTextPreference etp = (EditTextPreference) findPreference("the_pref_key"); etp.setSummary("New summary"); This requires that you display your preferences either from a PreferenceActivity or from a PreferenceFragment ,