Node is saved as draft in My Content >> Draft
How to improve your selection criteria of your Android app using Radio button
Radio Button
A radio button is a two-states button that can be either checked or unchecked. They are normally used together in a RadioGroup . When several radio buttons live inside a radio group, checking one radio button unchecks all the others.
Exmaple:-
First create a layout
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="5dp" >
<RadioGroup
android:id="@+id/genderRadioGroup
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<RadioButton
android:id="@+id/male"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Male" />
<RadioButton
android:id="@+id/female"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Female" />
</RadioGroup>
<Button
android:id="@+id/knowGender"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="5dp"
android:text="Know Gender" />
</LinearLayout>
0 Comment(s)