title: Programmatically Change Gradient Background of Widget
body: <p>What I am trying to accomplish:</p>
  
  <pre><code>int[] colors = new int[]{colorDark,colorLight}
  GradientDrawable gd = new GradientDrawable(TOP_BOTTOM, colors);
  remoteView.setBackgroundDrawable(gd); //method does not exist
  </code></pre>
  
  <p>Obviously this is not possible.</p>
  
  <p><strong>How can I accomplish this?</strong> (if it's possible)</p>
  
  <p>I do not want to have to create multiple shapes in xml files for different colors, because this limits options.</p>
  
  <p>I have tried converting my drawable to a bitmap and calling <code>setImageViewBitmap</code>. I converted with <a href="https://stackoverflow.com/a/10600736/802469">this code</a> and used <a href="https://stackoverflow.com/a/1016941/802469">this code</a> to get the width/height, but I'm unable to get the widget to be filled (additionally, the device's display width/height really aren't what I need anyway)</p>