The preference activity gets inflated by invoking
addPreferencesFromResource(R.xml.preferences);
and here are the preferences.xml:
<PreferenceCategory android:title="@string/pref_categ_update_label">
<ListPreference android:title="@string/pref_label"
android:key="update_interval"
android:entries="@array/update_names" android:entryValues="@array/update_values" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/pref_categ_evernote_label">
<EditTextPreference android:title="@string/pref_dialog_edit_username"
android:key="prefUsername"
android:positiveButtonText="@string/save_pref"
android:negativeButtonText="@string/cancel_pref" />
<EditTextPreference android:title="@string/pref_dialog_edit_password"
android:key="prefPassword"
android:positiveButtonText="@string/save_pref"
android:negativeButtonText="@string/cancel_pref"
android:password="true" />
</PreferenceCategory>
everything looks okay, but EditTextPreference entries (2 and 3) have arrow-down icons next to them, just like ListPreference (1) does. Why is it so and how can I remove these icons as they look irrelevant?
The screenshot is here: http://i.stack.imgur.com/BZUr7.png
If you dont want the arrows in preferences then use -
And if you want to give some custom image in preference right hand side then use -
where, pref_custom_image.xml will look like -
The arrows are there to let you know that clicking on that preference is going to take you somewhere else. In the case of the
ListPreference
it indicates that it goes to another "screen" in the case of theEditTextPreference
it indicated that it is going to pop up a dialog. If yo don't like it you can create a new style for it and use that instead.I'm not 100% sure if this is safe and good way, but you can remove the icon if you extend the EditTextPreference class like that:
By overiding the
getView()
method you can change what is drawn in the list. I'm using the original view and search it for all images (recursivly) and changing theirvisibility
toGONE
.If anyone is having this same issue, I've found a super simple solution to get rid of the arrow on preference items (technically, it gets rid of anything that would appear there--arrow image checkbox, etc.). In your preferences.xml, set the value for Widget Layout to "@null".