GradientDrawable in Code
<p>I can use the following XML just fine</p>

<pre><code>
&lt shape android:shape="rectangle" xmlns...">
     &lt gradient
         android:startColor="#255779"
         android:centerColor="#3e7492"
         android:endColor="#a6c0cd"
         android:angle="90" />

    &lt stroke android:width="1dp" android:color="#0d202e" />
&lt/shape>
</code>
</pre>

<p>the gradient come up nicely</p>

<p>i am trying to do the same thing just using code (no XMLs)</p>

<pre>
int colors[] = { 0xff255779 , 0xff3e7492, 0xffa6c0cd };

GradientDrawable g = new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, colors);

setBackgroundDrawable(g);
</pre>

<p>The gradient DOES come up but its not the same as the one the one from XML, i mean the colors are same but gradient is not same, i think it has to do with the start,middle,end colors in the xml</p>

<p>also how do i add a stroke</p>

<p>any help will be greatly appreciated</p>
