title: How to create shape with solid, corner, stroke in Java Code?
body: <p>I have a shape defined in the xml file below, now I want to change to solid color programmatically.</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="#DFDFE0" /&gt;
  
      &lt;corners
          android:bottomLeftRadius="8dp"
          android:bottomRightRadius="8dp"
          android:topLeftRadius="8dp"
          android:topRightRadius="8dp" /&gt;
  
      &lt;stroke
          android:width="3dp"
          android:color="#2E3135" /&gt;
  
  &lt;/shape&gt;
  </code></pre>
  
  <p>I think I should have a class which extends ShapeDrawable, and implements the onDraw method. Anyone knows how to?</p>