Simple radio button example Radio buttons are two-state button which allow the user to select one options from a group. If you have more than one radio button, then use radio group, so that when one radio button is selected, all others are automatically deselected. In this example, I’ll show a simple example of a radio button RadiobuttonExampleActivity.java package com.example; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.RadioButton; import android.widget.RadioGroup; import android.widget.Toast; public class RadiobuttonExampleActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super .onCreate(savedInstanceState); ...
If you are a beginner , then this blog will help you to dive into the basics.