androidandroid-edittextpreferencehintpreferencescreen

Android EdittextPreference Hint (android:hint)


I have a preference screen with an EditTextPreference. How to set a hint

either in xml like

android:hint

or in code like

setHint(int), setHint(CharSequence hint)

on the EditTextPreference like on an EditText field? I assumed that it´s like on the EditText but i didn´t find anything like this. Thanks.


Solution

  • Use android:summary to give a brief description of your preference.

    You can also set this dynamically using setSummary(CharSequence summary) .

    EDIT: for giving a 'hint' you could use android:defaultValue .