title: How do I set a different color for the pressed state of the button?
body: <p>I have some <code>Buttons</code> on my android app. They have an icon and text. I can set the background color of a <code>Button</code> in java code. If the button is clicked I want to display with a different color.  So, how do I set a different color for the pressed state of the <code>Button</code>?</p>
  
  <pre><code>&lt;Button 
    android:id="@+id/save" 
    android:layout_width="130dip"
    android:layout_height="wrap_content" 
    android:scaleType="center"
    android:drawableTop="@drawable/save"
    android:text="Save"
    android:textColor="#FFFFFF"
    android:textSize="14dip" 
  &gt;
  </code></pre>
  
  <p>The <code>onCreate</code> method:</p>
  
  <pre><code>public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.homescreen);
   save = (Button)findViewById(R.id.save);
      save.setBackgroundColor(Color.rgb(27,161,226)); }
  </code></pre>