I have a list with items, and 2 colorliststates, one for the odds, one for the evens. basically, it ressembles this :
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="false" android:color="#fff" />
<item android:state_pressed="true" android:color="#999" />
</selector>
How can I use apply the colorliststate to the items? in the layout, there is no notion of odd or even, so i can't. In the java code, I can't find a way of using the colorliststate once i load it :
getContext().getResources().getColorStateList(R.color.list_even);
Any idea ?