0

Here is the :

   <EditTextPreference
       android:key="backend_url"
       android:title="@string/pref_backend_url_title"
       android:summary="@string/pref_backend_url_description"
       android:defaultValue="@string/pref_backend_url"
       android:selectAllOnFocus="true"
       android:singleLine="true"
       android:maxLines="1" />

After you click on the preference in a Settings fragment, the value is not selected, which is the expected behavior.

dmfrey
  • 1,230
  • 1
  • 17
  • 33
  • try this. http://stackoverflow.com/questions/28383400/android-how-to-set-default-value-of-edittextpreference-from-sharedpreference – Nguyễn Trung Hiếu Apr 13 '16 at 03:14
  • That doesn't mention the selectAllOnFocus property at all. Thanks, though. – dmfrey Apr 13 '16 at 03:20
  • Are you using the preference-v7 EditTextPreference? If so, it seems like there are a lot of attributes that aren't honored. See: https://code.google.com/p/android/issues/detail?id=185164&can=1&q=selectAllOnFocus&colspec=ID%20Status%20Priority%20Owner%20Summary%20Stars%20Reporter%20Opened – Lyla Oct 13 '16 at 23:37
  • @Lyla thanks. that was key. I was using preference-v7. I am gonna remove that until it matures a bit. – dmfrey Jan 23 '17 at 01:05

1 Answers1

0

Thanks to the tip from @Lyla. I removed the preference-v7 library until it matures a bit. Will revisit it at some point in the future.

dmfrey
  • 1,230
  • 1
  • 17
  • 33