Added in API level 1

RadioButton


open class RadioButton : CompoundButton
kotlin.Any
   ↳ android.view.View
   ↳ 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 android.widget.CheckBox, a radio button cannot be unchecked by the user once checked.

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

See the Radio Buttons guide.

XML attributes

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

Summary

Inherited XML attributes
Inherited constants
Public constructors
RadioButton(context: Context!)

RadioButton(context: Context!, attrs: AttributeSet!)

RadioButton(context: Context!, attrs: AttributeSet!, defStyleAttr: Int)

RadioButton(context: Context!, attrs: AttributeSet!, defStyleAttr: Int, defStyleRes: Int)

Public methods
open CharSequence!

open Unit

open Unit

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

Inherited functions