title: How to change button background in java?
body: <p>I have xml file in drawable folder for rounded button - rounded.xml.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;shape xmlns:android="http://schemas.android.com/apk/res/android"
      android:shape="rectangle"&gt;
      &lt;solid android:color="#ccc" /&gt;
      &lt;corners android:radius="5dp" /&gt;
      &lt;stroke android:width="1dp" android:color="#000" /&gt;
  &lt;/shape&gt;
  </code></pre>
  
  <p>Usually I set it by using <code>android:background = "@drawable/rounded"</code> inside button xml, but I would like to create few xml files with different colors so that I could change app theme.</p>
  
  <p>Do you know how should I set background for button, but in java?</p>