I have a PreferenceActivity
with some preference items, and an "account" PreferenceCategory
that shows the accounts configured in the application. Each account preference is a PreferenceScreen
, with other options inside. I want to highlight the active account and the question is: is there anyway to show a tick icon (drawable) on the right side of a PreferenceScreen
? I mean in the ListView
, not in the detail of the PreferenceScreen
.
Asked
Active
Viewed 202 times
2

Infinite Recursion
- 6,511
- 28
- 39
- 51

jihonrado
- 409
- 2
- 11
-
Do you mean you want a Checkbox in the list? – John J Smith Aug 13 '11 at 09:21
-
@John, no, a CheckBoxPreference isn't what I want because it suggests that you could tick on any item on the list and I only what to highlight one item on that list with a drawable. – jihonrado Aug 14 '11 at 11:58
-
A CheckBoxPreference will only control one item in the list. Other items in the list can be whatever you want them to be e.g. a ListPreference, etc. – John J Smith Aug 14 '11 at 14:28
-
1That's correct, but the hightlighted preference hasn't to be clickable nor having checkbox appearance to not confuse the user. Finally I found a solution, that was to built my own custom preference, subclass of "Preference". As I can't respond to my own question, I let the code on a pastebin: http://pastebin.com/kVd4i5VQ, http://pastebin.com/k17fXtqY – jihonrado Aug 15 '11 at 10:17