Custom button drawable state_pressed and state_checked not working on CheckBox or RadioButton - Android
<p>I am setting custom drawable to the checkbox button,<br>
But only <code>android:state_checked="true"</code> and <code>android:state_checked="false"</code> seem to work.<br>
Other states aren't working.  </p>

<p>I am unable to set a custom drawable on pressed state.</p>

<p><strong>This is the selector I am using:</strong>  </p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;selector xmlns:android="http://schemas.android.com/apk/res/android"&gt;
    &lt;item android:state_checked="true" android:drawable="@drawable/radio_btn_selected" /&gt;
    &lt;item android:state_checked="false" android:drawable="@drawable/radio_btn_normal" /&gt;
    &lt;item android:state_pressed="true"  android:drawable="@drawable/radio_btn_pressed" /&gt;
    &lt;item android:state_focused="true"  android:drawable="@drawable/radio_btn_pressed" /&gt;
    &lt;item android:drawable="@drawable/radio_btn_normal"/&gt; &lt;!-- default --&gt;
&lt;/selector&gt;
</code></pre>

<p><strong>This is how I am setting it to radio button:</strong>  </p>

<pre><code>radioButton.setButtonDrawable(R.drawable.radio_btn_selectors);
</code></pre>