I want to set the icon in ListPreference
items in android.
What to write in ListPreference
or where to write to set the list items icon?
I want to set the icon in ListPreference
items in android.
What to write in ListPreference
or where to write to set the list items icon?
You need to use a custom layout for your
ListPreference
.eg:
And add what you want to your custom layout.
eg:
When you need multiple uses of a list preference with texts/icons, then you can use this solution.
This version is heavily based on the nice version of LucaZanini. I made some minor changes to the version so it is only dependant on the own preference attributes. In this way you can use them multiple times. Please refer to his tutorial.
@Luca - thank you very much!
The minor changes are only:
IconPickerPreference: