title: How to change stroke color dynamically?
body: <p>(Sorry for my language, I'm french)</p>
  
  <p>I need to change the <code>stroke color</code> of a Shape.
  I've the same problem described <a href="https://stackoverflow.com/questions/16775891/how-to-change-solid-color-from-the-code">here</a>.
  I need to change solid color when the EditText is not correct.</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" android:padding="10dp"&gt;
      &lt;solid android:color="#FFFFFF"/&gt;
      &lt;corners
          android:bottomRightRadius="5dp"
          android:bottomLeftRadius="5dp"
          android:topLeftRadius="5dp"
          android:topRightRadius="5dp"/&gt;
      &lt;stroke android:width="2px" android:color="#CCCCCC"/&gt;
  &lt;/shape&gt;
  </code></pre>
  
  <p>The answer :</p>
  
  <pre><code>GradientDrawable myGrad = (GradientDrawable)rectangle.getBackground();
  myGrad.setColor(Color.BLACK);
  </code></pre>
  
  <p>Problem in the answer is, I don't understand the <strong>rectangle</strong> item.
  If I replace it by the EditText, it is applied to the background, not the solid background.</p>
  
  <p>Thanks in advance.</p>
  
  <p>EDIT : My Bad, i want to change the <strong>Stroke</strong> color, not solid.</p>