button background color is always purple in android studio

Viewed 2739

I am coding in android studio for some months and everything worked great. In the last 2 weeks I updated android studio and since then, every time I put a button its color is defined as purple no matter what I am doing, even if I change its background. I tried to change it from the xml and also from the java file but without success. If someone knows how to change it, it would be very helpful. Thanks for answers.

the color of the button

2 Answers

Instead of button use <androidx.appcompat.widget.AppCompatButton>

Setting the app:backgroundTint to the color or transparent as well fixed this for me.

Related