Added in API level 1

RadioGroup


open class RadioGroup : LinearLayout
kotlin.Any
   ↳ android.view.View
   ↳ android.view.ViewGroup
   ↳ android.widget.LinearLayout
   ↳ android.widget.RadioGroup

This class is used to create a multiple-exclusion scope for a set of radio buttons. Checking one radio button that belongs to a radio group unchecks any previously checked radio button within the same group.

Intially, all of the radio buttons are unchecked. While it is not possible to uncheck a particular radio button, the radio group can be cleared to remove the checked state.

The selection is identified by the unique id of the radio button as defined in the XML layout file.

XML Attributes

See RadioGroup Attributes, LinearLayout Attributes, ViewGroup Attributes, View Attributes

Also see LinearLayout.LayoutParams for layout attributes.

Summary

Nested classes
open

This set of layout parameters defaults the width and the height of the children to WRAP_CONTENT when they are not specified in the XML file.

abstract

Interface definition for a callback to be invoked when the checked radio button changed in this group.

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

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

Public methods
open Unit
addView(child: View!, index: Int, params: ViewGroup.LayoutParams!)

open Unit

open Unit
check(id: Int)

Sets the selection to the radio button whose identifier is passed in parameter.

open Unit

Clears the selection.

open RadioGroup.LayoutParams!

Returns a new set of layout parameters based on the supplied attributes set.

open CharSequence!

open Int

Describes the autofill type of this view, so an android.service.autofill.AutofillService can create the proper AutofillValue when autofilling the view.

open AutofillValue?

open Int

Returns the identifier of the selected radio button in this group.

open Unit

open Unit

Register a callback to be invoked when the checked radio button changes in this group.

open Unit

Register a callback to be invoked when a child is added to or removed from this view.

Protected methods
open Boolean

open LinearLayout.LayoutParams!

open Unit

Finalize inflating a view from XML.

Inherited functions