Reputation: 6577
I have an array of radio button from where i am creating radio buttons dynamically in my layout. Here what i want, when i check one radio button then other radio buttons should be unchecked. How to manipulate this using radio button array? Please some body help!
Here is the image. Radio Buttons does not unchecked automatically.
Upvotes: 0
Views: 1135
Reputation: 192
Yes, RadioButtons does this automatically. Here is the code for your reference. Hope it helps you.
<RadioButton android:id="@+id/radio_red"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Red" />
<RadioButton android:id="@+id/radio_blue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Blue" />
Upvotes: 0
Reputation: 553
RadioButtons does this automatycally but you have to group them in a RadioGroup: http://developer.android.com/intl/es/reference/android/widget/RadioGroup.html
Upvotes: 2