How to change the button color in android studio?
1 answer(s)
Answer # 1 #
The simplest way is in your XML layout file. Just find your <Button> and add the android:backgroundTint attribute. For example, you can use android:backgroundTint="#FFC107" to get a nice amber color. This is the modern way to do it, and it works great with Material Design themes. You can also set the color programmatically in your Kotlin or Java code if you need it to change dynamically while the app is running.