Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change selector color of a Preference

I couldn't find any info related.

I have implemented my custom theme with Android-holo-colors assets in the rest of my app without any problems, until I began developing the PreferenceActivity.

I just can't find how can I change the selector color of any preference, it's remains the default value (Holo-blue).

Any ideas?

Thanks BTW.

EDIT: I tried to set the main theme in the Activity label at the Manifest, but does not worked for me. I presume that is because I didn't specify nothing that overwrites any Preference style, but that's my problem, I don't know which ones I have to overwrite.

like image 290
MiguelCatalan Avatar asked Aug 25 '13 19:08

MiguelCatalan


1 Answers

In your PreferenceActivity onCreate, after you have added your preferences, call:

getListView().setSelector(R.drawable.your_selector);
like image 191
dennisdrew Avatar answered Oct 30 '22 02:10

dennisdrew