I want to create a selector using the code below:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="true" android:drawable="@drawable/sh_radio_icon_checked" />
<item android:state_checked="false" android:drawable="@drawable/sh_radio_icon_unchecked" />
</selector>
So far I have managed to add the first item, like this:
StateListDrawable drawable = new StateListDrawable();
int[] sFocusedSelected = {android.R.attr.state_checked};
Drawable dFocusedSelected = getResources().getDrawable(R.drawable.sh_radio_icon_checked);
drawable.addState(sFocusedSelected, dFocusedSelected);
But do I add the state_checked=false since there's no state_unchecked constant?