I\'m new to android programming. How do I change the color of a button?
You can change the value in the XML like this:
Here, you can add any other color, from the resources or hex.
Similarly, you can also change these values form the code like this:
demoButton.setBackgroundColor(Color.WHITE);
Another easy way is to make a drawable, customize the corners and shape according to your preference and set the background color and stroke of the drawable. For eg.
button_background.xml
And then set this shape as the background of your button.
Hope this helps, good luck!