activitymain.xml
now make a new folder in resource directory and named it a drawable. put this blue_button.xml in drawable folder:
blue_button.xml
And copy this code inside your styles.xml in values folder: Insert this code after the tag in styles.xml
Notice the change of color when you tap the button! We don't need any activity.java here! GoodLuck!
You may also like:Change color of Button in Android when Clicked