I could list my current selected value using %s in the summary attribute of ListPreference

<ListPreference
        android:key="my_list_setting_key"
        android:title="Just title"
        android:summary="My current selected value: %s"
        android:dialogTitle="My title"
        android:entries="@array/my_list_setting_entries_key"
        android:entryValues="@array/my_list_setting_entries_value"
        android:defaultValue="default_value"/>

However for EditTextPreference, the below %s is not working.

<EditTextPreference
        android:key="my_text_setting_key"
        android:title="My title"
        android:summary="My current value : %s"
        android:dialogTitle="My title"
        android:defaultValue="default_value"/>

How could I list the current value in the EditTextPreference summary (or anywhere that is visible before opening up the dialog box)?

0 Answers