Skip to content
Advertisement

How can I change the text color and the tint color of radiobuttons in a Alert?

Right now I have a button and when clicked it pops up with an AlertDialog with 3 radiobuttons. enter image description here

I want to change the text color and the tint color to match what I have on the rest of the app. Besides the call to the method this is all the code I have for the Alert:

JavaScript

I have tried to change them in the style but none of it works, I can only seem to change the textcolor of the alert and not the radiobuttons. Any idea? I do not have a layout for the Alert so I can’t do a findById for the radiogroup. I am doing this in Java and not Kotlin.

Advertisement

Answer

Add to RadioButton XML the app:buttonTint option as follows:

JavaScript

Also, go to color.xml and add the color you want to be the RadioButton

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement