1

I'm trying to add an image / icon to certain entries of a ListPreference alongside the text.

I would like achieve this programmatically.

Here's an excerpt of the preferences.xml

<ListPreference
  android:key="prefGameMode"
  android:title="@string/pref_game_mode"
  android:summary="@string/pref_game_mode_desc"
  android:defaultValue="fourChallenge"
  android:entries="@array/arrGameMode"
  android:entryValues="@array/arrGameModeValues" 
  android:negativeButtonText="@string/cancel" />
...

The goal here is to illustrate that some of the options listed are unavailable/ locked in the current version of the app. However, the code-base is used as a library, so I would like the solution to work via code, rather than xml.

Any ideas how to do this? Thanks.

pjama
  • 3,014
  • 3
  • 26
  • 27
  • possible duplicate of [custom row in a listPreference?](http://stackoverflow.com/questions/4549746/custom-row-in-a-listpreference) – bwest Jun 21 '15 at 01:36

1 Answers1

0

Preferences already gives you a way to indicate that an option is unavailable: just set enabled properly.

Cheryl Simon
  • 46,552
  • 15
  • 93
  • 82
  • Hi Mayra, I actually want modify individual entries of the list preference, not the actual Preference itself. I want to keep everything enabled because the '_locked_' options trigger the creation of a new intent. – pjama Jan 27 '11 at 20:35