RadioButton Example in Android

When we need to select one option from multiple choice, then we can use RadioButton in Android. RadioButton is two states button, checked and unchecked which is used to select one option.

Normally single RadioButton is work as one time checked mean we only checked it one time.

RadioButton is mostly used with RadioGroup. RadioGroup is collection of RadioButton. Using RadioGroup we can able to select only one option from collection. Its mean when you select one RadioButton other were automatically unchecked and only one selected.

Let’s see one example of RadioButton and RadioGroup.

activity_main.xml

MainActivity.java

Now run project.Our output look like below.

android-radio-button-output-skynils

Download Project.

downlod

Now See next tutorial ImageView In Android.