title: how to change color of custom state button programmatically
body: <p>considering  <a href="https://stackoverflow.com/a/18879660/3138818">How to make the corners of a button round</a><br>
  how to change background color programmatically ?</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_pressed="true" &gt;
   &lt;shape android:shape="rectangle"  &gt;
       &lt;corners android:radius="3dip" /&gt;
       &lt;stroke android:width="1dip" android:color="#5e7974" /&gt;
       &lt;gradient android:angle="-90" android:startColor="#345953" android:endColor="#689a92"  /&gt;            
   &lt;/shape&gt;
  &lt;/item&gt;
  &lt;item android:state_focused="true"&gt;
   &lt;shape android:shape="rectangle"  &gt;
       &lt;corners android:radius="3dip" /&gt;
       &lt;stroke android:width="1dip" android:color="#5e7974" /&gt;
       &lt;solid android:color="#58857e"/&gt;       
   &lt;/shape&gt;
    &lt;/item&gt;  
  &lt;item &gt;
  &lt;shape android:shape="rectangle"  &gt;
       &lt;corners android:radius="3dip" /&gt;
       &lt;stroke android:width="1dip" android:color="#5e7974" /&gt;
       &lt;gradient android:angle="-90" android:startColor="#8dbab3" android:endColor="#58857e" /&gt;            
   &lt;/shape&gt;
   &lt;/item&gt;
   &lt;/selector&gt;
  </code></pre>