I'm new to android studio and am trying to have a 2 x 2 layout for some radio buttons. I have looked online and they're are similar question so apologies for a bit of a repeat but whatever I do I cannot seem to get mine to work. This is what I have in my xml file.
<RadioGroup
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/radioGroup">
<TableRow>
<RadioButton
android:id="@+id/radio1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:text="@string/text1" />
<RadioButton
android:id="@+id/radio2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/text2" />
</TableRow>
<TableRow>
<RadioButton
android:id="@+id/radio3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/text3"/>
<RadioButton
android:id="@+id/radio4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/text4"/>
</TableRow>
</RadioGroup>
Can anyone explain why that doesn't work? It just lets me select all the buttons.