Hide radio button icon but not text

XML:

<RadioButton
   android:paddingLeft="31dp"
   android:button="@android:color/transparent" />

Java:

RadioButton myButton = (RadioButton) findViewById(R.id.radio);
   myButton.setButtonDrawable(android.R.color.transparent);
   myButton.setPadding(31, 0, 0, 0);

setPadding() takes int values that represent Padding in Pixels, see Definition@Google so adjust the Padding as required.


set android:button="@null" will remove the default radio icon

<RadioButton
     android:id="@+id/rb1"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:button="@null"
     android:text="Female" />

Old post, but it might help someone. Setting android:button="@null" didn't worked for me for older versions. The only way that I could hide the circle was setting this style to the RadioButton

<style name="Radio" parent="Widget.AppCompat.CompoundButton.RadioButton">
  <item name="buttonCompat">@null</item> <!-- Key! -->
  <item name="android:button">@null</item>
</style>

In order to hide the circle button, there is needed just declare the following

<RadioButton
  app:buttonCompat="@null"
  android:button="@android:color/transparent" />