title: GradientDrawable in Code
body: <p>I can use the following XML just fine</p>
  
  <pre><code>&lt;shape android:shape="rectangle" xmlns..."&gt;
       &lt;gradient
           android:startColor="#255779"
           android:centerColor="#3e7492"
           android:endColor="#a6c0cd"
           android:angle="90"/&gt;
  
      &lt;stroke android:width="1dp" android:color="#0d202e"/&gt;
  &lt;/shape&gt;
  </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>