android - Change background color of programmatically created radio button



I used various method but I couldn't find a way to change color of a RadioButton that's created programmatically. Is there any other way than using a background Image? with minSDKVersion is 21. The below way I'm creating my RadioButton.

RadioButton radio = new RadioButton(co);

2 Answers: 

To change RadioButton button color programmatically use this. because your minSdk is 21. You can use setButtonTintList this way.

RadioButton raPrivate = new RadioButton(co);
int textColor = Color.parseColor(#000000);

Try this if you want to change background color of Radio Button: