android add ImageView selector programmatically
<p>I want to change ImageView background (in my case gradient color) using selector state programmatically not by using xml file.</p>

<p>I want pressed and default state to my ImageView</p>

<p>For creating gradient background I use this code:</p>

<pre><code> GradientDrawable gd = new GradientDrawable(
                    GradientDrawable.Orientation.BOTTOM_TOP,
                    new int[] {Color.parseColor(startColour), Color.parseColor(endColour)});
</code></pre>

<p>How can I implement selector  for this?</p>

<p>Thanks</p>
