How to change the color of shape set in imageview
<p>Now problem starts with just setting the color of a shape.
I created one rectangle shape in drawable and set it to ImageView like this</p>

<pre><code>&lt;LinearLayout 
        android:layout_width="0dp" 
        android:layout_height="fill_parent" 
        android:orientation="vertical" 
        android:layout_weight="0.15" 
        android:layout_marginRight="10dp"
        android:gravity="center_vertical"&gt;
       &lt;ImageView 
        android:id="@+id/iv_priority"
        android:src="@drawable/case_priority"
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content"/&gt;
&lt;/LinearLayout&gt;
</code></pre>

<p><strong>EDIT</strong></p>

<p>My case_priority.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="#009600" /&gt;
  &lt;size android:width="30dp"
        android:height="30dp" /&gt;
&lt;/shape&gt;
</code></pre>

<p>now I need to change the color of this shape. Actually this color is coming from web service, and I need to change it.
So My <strong>Question</strong> is: How can we change color of this shape programmatically. and set it to imageview. 
I have gone through few examples in stackoverflow but I am not able to change it to image view.Please Help!!!!
Thanks in advance.</p>

<p><strong>EDIT:</strong></p>

<p>May be I was not clear in my question, So Just a refinement to question . Actually I have a ImageView  where I set a source which is actually a drawable. By default its green as in my code shown above. Now web service returns the color of this image view which needs to be changed accordingly , so I can't change it from xml during runtime so I need to change it from java file. Since I am using shape and image view, .setBackground() won't help much here. So What can be the probable solution for this. Thanks for answer and sorry for inconvenience.</p>
