I'm new to android please let me know what I have made wrong, I have added a radio group and next added Gridlayout to align radio buttons in 2x2 form of matrix, it aligned good, but problem is that it is not deselecting previously selected options when I select any radio button. How can I achieve this ?
All radio buttons are getting selected. None of them are deselecting upon changing selection of radio button. Please suggest me any approach.
Thanks
<RadioGroup
android:layout_width="match_parent"
android:layout_height="wrap_content">
<GridLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New RadioButton"
android:id="@+id/radOption1"
android:layout_row="0"
android:layout_column="0"
android:padding="5dp" />
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New RadioButton"
android:id="@+id/radOption2"
android:layout_row="0"
android:layout_column="1"
android:padding="5dp" />
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New RadioButton"
android:id="@+id/radOption3"
android:layout_row="1"
android:layout_column="0"
android:padding="5dp" />
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New RadioButton"
android:id="@+id/radOption4"
android:layout_row="1"
android:layout_column="1"
android:padding="5dp" />
</GridLayout>
</RadioGroup>