How to use ColorDrawable with ImageView?
<p>I have a layout with an ImageView defined like:</p>

<pre><code>&lt;ImageView
  android:layout_width="45dip"
  android:layout_height="45dip"
  android:scaleType="fitXY" /&gt;
</code></pre>

<p>now I just want to set the imageview to be a static color, like red or green. I'm trying:</p>

<pre><code>ColorDrawable cd = new ColorDrawable("FF0000");
cd.setAlpha(255);
ImageView iv = ...;
iv.setImageDrawable(cd);
</code></pre>

<p>the imageview is just empty though, no color. The 45dip space is being used up though. What do I need to do to get the color to be rendered?</p>

<p>Thanks</p>
