Android set background color of preference category

admin

Administrator
Staff member
I try to customize the background color of preference categories. I already changed the background color of a preferences itself but I can't find a way how to change the the categories background color.

I found two ways but they don't works for me:
<a href="https://stackoverflow.com/questions/7048089/changing-the-preference-category-label-color-background">changing the preference category label color background</a>

Through <a href="https://stackoverflow.com/questions/5571603/change-preferenceactivity-text-color">this link</a>, i found <a href="http://udinic.wordpress.com/2011/08/18/dress-up-your-preferenceactivity/" rel="nofollow noreferrer">this</a>, but nothing I've tried worked for me. These layout snippet is what I've tried so far:

Code:
&lt;resources&gt;
    &lt;style name="setBackgroundTheme" parent="android:Theme"&gt;
        &lt;item name="android:background"&gt;@color/darkbluelogo&lt;/item&gt;
    &lt;/style&gt;
&lt;/resources&gt;

In
Code:
onCreate
method I set the theme with:

Code:
setTheme(R.style.setBackgroundTheme);