I\'m new to android programming. How do I change the color of a button?
If you are trying to set the background as some other resource file in your drawable folder, say, a custom-button.xml, then try this:
button_name.setBackgroundResource(R.drawable.custom_button_file_name);
eg. Say, you have a custom-button.xml file. Then,
button_name.setBackgroundResource(R.drawable.custom_button);
Will set the button background as the custom-button.xml file.