The introduction of Android User Interface (UI) Radio Button

Android Radio Button (Source Google Images)

Radio buttons are used when we want to choose only one item from the list of items.

android: orientation: Can be horizontal or vertical

setOnCheckedChangeListener (): It records a callback to be called when the radio button is checked changed in this group.

and following the example of syntax applied to the layout (xml).

<RadioButton
            android:id="@+id/radioButton1"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:text="Radio Button 1 "
            android:textSize="18sp"/>

Source: Master Android (App)

Post Author: Study