How to change the color of the color button when pressed in Android?
I have some buttons which I set its background color as red, green and blue separately. When I press the button, click event is generated, but there is no change in gui for the user to know the button is pressed. Android button’s default background grayish color changes to orange and come back to grayish color after releasing the pressed state. How to implement this on colored button? That is implemented via a StateListDrawable , represented by selector in XML . Reference: http://developer.android.com/guide/topics/resources/drawable-resource.html#StateList Here is an example of a drawable that