In this example showing Radio buttons with a radio group and determining which radio button is selected.
Radio buttons are normally used together in a Radio Group. When several radio buttons live inside a radio group, checking one radio button unchecks all the others.
we will use “android.widget.Radio Button” class to render radio button, and those radio buttons are usually grouped by android.widget.Radio Group. If Radio Buttons are in group, when one Radio Button within a group is selected, all others are automatically deselected.
Create project in android studio as RadioGroupExample