To change the text color of a radio object:
Red.setOnCheckedChangeListener(new OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { if (isChecked) { Red.setTextColor(Color.RED); } } });
For custom icons; create radiobutton.xml in your folder with this:
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/checked_icon" android:state_checked="true"/> <item android:drawable="@drawable/unchecked_icon" android:state_checked="false"/> </selector>
And put these lines in your styles.xml (in the values folder):
<?xml version="1.0" encoding="utf-8"?> <resources> <style name="CustomTheme" parent="android:Theme"> <item name="android:radioButtonStyle">@style/RadioButton</item> </style> <style name="RadioButton" parent="@android:style/Widget.CompoundButton.RadioButton"> <item name="android:button">@drawable/radiobutton</item> </style> </resources>
source share