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?
Share
That is implemented via a
StateListDrawable, represented byselectorin XML. Reference: http://developer.android.com/guide/topics/resources/drawable-resource.html#StateListHere is an example of a drawable that will be white by default, black when pressed: