android studio set button background code example
Example 1: how to set background image on button in android
btn.setBackgroundResource(R.drawable.new_todo_image);
Example 2: android studio change button color programmatically
// If you're in an activity:
Button11.setBackgroundColor(getResources().getColor(R.color.red));
// OR, if you're not:
Button11.setBackgroundColor(Button11.getContext().getResources().getColor(R.color.red));