title: Android replace checkbox style with custom drawable selector
body: <p>I have tried to make a xml selector with the following:</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:drawable="@drawable/shuffleon" android:state_checked="true" /&gt;
      &lt;item android:drawable="@drawable/shuffleoff" android:state_selected="false" /&gt;
  &lt;/selector&gt;
  </code></pre>
  
  <p>and when I try to set the <code>backgroundDrawable</code> to the <code>checkBox</code> the checkbox doesn't replace the <code>CheckBox</code> style too:</p>
  
  <pre><code>  shuffle.setBackground(android.support.v4.content.res.ResourcesCompat.getDrawable(getResources(), R.drawable.shuffle, null));
  </code></pre>
  
  <p>Following this question: <a href="https://stackoverflow.com/questions/3192173/change-icons-of-checked-and-unchecked-for-checkbox-for-android">Change icons of checked and unchecked for Checkbox for Android</a> I need to set the <code>button drawable</code> with my xml: <code>android:button="@drawable/checkbox"</code> but I can't do this because I'm creating the <code>CheckBox</code> programmatically.
  Is there a way how to achieve this?</p>