android change button color programmatically

android change button color programmatically
//Set button color to red
Button1.setBackgroundColor(0xFFFF0000);
Button2.setBackgroundColor(Button11.getContext().getResources().getColor(R.color.red));

// The button is in activity
Button3.setBackgroundColor(getResources().getColor(R.color.red));
Source:ww‮‬w.lautturi.com
Created Time:2017-09-02 11:24:02  Author:lautturi