get color of oval shaped view
<p>In android I am creating views that I have given an oval shape and a solid color. Now I want to dynamically get and set the color of the circle. But the getBackground() returns a GradientDrawable, which <a href="http://stackoverflow.com/questions/7925978/android-gradient-drawable-color-change">has no methods</a> for getting the color. Is there any (easy) way to do it anyway?</p>

<p>I prefer to not use a canvas, because I am working with a lot of elements that are all views, which makes it easier.</p>

<p>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="oval"&gt;
    &lt;solid
        android:color="#ffff3333"
        /&gt;
&lt;/shape&gt;
</code></pre>
