how to change button color tint programmatically in android

https:/‮al.www/‬utturi.com
how to change button color tint programmatically in android
Drawable buttonDrawable = button.getBackground();
buttonDrawable = DrawableCompat.wrap(buttonDrawable);

//the color is a direct color int and not a color resource 
DrawableCompat.setTint(buttonDrawable, Color.RED);
button.setBackground(buttonDrawable);
Created Time:2017-09-09 22:35:17  Author:lautturi