title: Change Radio Button Color
body: <p>So I'm dynamically creating radio buttons at runtime but I want to change the background of the button. I've created a selector xml file in my drawables folder that is shown below:</p>
  
  
  
  <p></p>
  
  <pre><code>&lt;item android:drawable="@drawable/btn_radio_on_holo_light" android:state_checked="true" android:state_enabled="true" android:state_window_focused="false"/&gt;
  &lt;item android:drawable="@drawable/btn_radio_off_holo_light" android:state_checked="false" android:state_enabled="true" android:state_window_focused="false"/&gt;
  &lt;item android:drawable="@drawable/btn_radio_on_pressed_holo_light" android:state_checked="true" android:state_enabled="true" android:state_pressed="true"/&gt;
  &lt;item android:drawable="@drawable/btn_radio_off_pressed_holo_light" android:state_checked="false" android:state_enabled="true" android:state_pressed="true"/&gt;
  &lt;item android:drawable="@drawable/btn_radio_on_focused_holo_light" android:state_checked="true" android:state_enabled="true" android:state_focused="true"/&gt;
  &lt;item android:drawable="@drawable/btn_radio_off_focused_holo_light" android:state_checked="false" android:state_enabled="true" android:state_focused="true"/&gt;
  &lt;item android:drawable="@drawable/btn_radio_off_holo_light" android:state_checked="false" android:state_enabled="true"/&gt;
  &lt;item android:drawable="@drawable/btn_radio_on_holo_light" android:state_checked="true" android:state_enabled="true"/&gt;
  &lt;!-- Disabled states --&gt;
  &lt;item android:drawable="@drawable/btn_radio_on_disabled_holo_light" android:state_checked="true" android:state_window_focused="false"/&gt;
  &lt;item android:drawable="@drawable/btn_radio_off_disabled_holo_light" android:state_checked="false" android:state_window_focused="false"/&gt;
  &lt;item android:drawable="@drawable/btn_radio_on_disabled_focused_holo_light" android:state_checked="true" android:state_focused="true"/&gt;
  &lt;item android:drawable="@drawable/btn_radio_off_disabled_focused_holo_light" android:state_checked="false" android:state_focused="true"/&gt;
  &lt;item android:drawable="@drawable/btn_radio_off_disabled_holo_light" android:state_checked="false"/&gt;
  &lt;item android:drawable="@drawable/btn_radio_on_disabled_holo_light" android:state_checked="true"/&gt;
  </code></pre>
  
  <p></p>
  
  <p>Does anyone know the java code that uses this drawable to update the radio button at runtime? Thanks!</p>