Android
android.widget
public class

android.widget.RadioButton

java.lang.Object
android.view.View Drawable.Callback KeyEvent.Callback
android.widget.TextView ViewTreeObserver.OnPreDrawListener
android.widget.Button
android.widget.CompoundButton Checkable
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)
            RadioButton(Context context, AttributeSet attrs, int defStyle)

Public Methods

          void  toggle()
Change the checked state of the view to the inverse of its current state

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
Methods inherited from class android.view.View
Methods inherited from class java.lang.Object
Methods inherited from interface android.graphics.drawable.Drawable.Callback
Methods inherited from interface android.view.KeyEvent.Callback
Methods inherited from interface android.view.ViewTreeObserver.OnPreDrawListener
Methods inherited from interface android.widget.Checkable

Details

Public Constructors

public RadioButton(Context context)

public RadioButton(Context context, AttributeSet attrs)

public RadioButton(Context context, AttributeSet attrs, int defStyle)

Public Methods

public void toggle()

Change the checked state of the view to the inverse of its current state

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

Copyright 2007 Google Inc. Build 0.9_r1-98467 - 14 Aug 2008 18:48