title: How to add a gradient to buttons in android through xml?
body: <p>I cannot figure out why this code will not work. Can anyone help? I am trying to get the button to use a custom color titled 'greenstart' and 'greenend'. The colors have been created in the res/value/string.xml file. I have looked at similar questions but either they were left unanswered, unclear, or the solution did not work. Thanks in advance.</p>
  
  <p>XML FILE SAMPLE:</p>
  
  <pre><code>&lt;Button
     android:id="@+id/mycollection"
     android:layout_width="match_parent"
     android:layout_height="fill_parent"
     android:layout_weight="1" &gt;
  
     &lt;Gradient
        android:angle="270"
        android:endColor="@color/greenstart"
        android:startColor="@color/greenend" &gt;
     &lt;/Gradient&gt;
  &lt;/Button&gt;
  </code></pre>