English | Site Directory

Android - An Open Handset Alliance Project

android.widget
public class

android.widget.RadioButton

java.lang.Object
android.view.View Drawable.Callback KeyEvent.Callback
android.widget.TextView
android.widget.Button
android.widget.CompoundButton
android.widget.RadioButton

A radio button is a two-states button that can be either checked or unchecked. When the radio button is unchecked, the user can press or click it to check it. However, contrary to a CheckBox, a radio button cannot be unchecked by the user once checked.

Radio buttons are normally used together in a RadioGroup. When several radio buttons live inside a radio group, checking one radio button unchecks all the others.

XML attributes

See CompoundButton Attributes, Button Attributes, TextView Attributes, View Attributes

Summary

XML Attributes inherited from class android.widget.TextView
XML Attributes inherited from class android.view.View
Constants inherited from class android.view.View
Fields inherited from class android.view.View

Public Constructors

          RadioButton(Context context)
          RadioButton(Context context, AttributeSet attrs, Map inflateParams)
          RadioButton(Context context, AttributeSet attrs, Map inflateParams, int defStyle)

Public Methods

        void  toggle()

If the radio button is already checked, this method will not toggle the radio button.

Methods inherited from class android.widget.CompoundButton
Methods inherited from class android.widget.TextView