As the title describes, I'm trying to group up a grid of 3x3 radio buttons into a single radio group. In a previous question asked I learned that for radio buttons to correspond to a single group they had to be the immediate children of the radio group to which they will correspond. I learned this the hard way when I attempted to encapsulate an entire table layout (with the radio buttons in the table rows) in a radio group.
Running into that wall, I tried the following:
<TableLayout android:id="@+id/table_radButtons"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/title_radGroup_buffer">
<TableRow>
<RadioGroup android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:id="@+id/radGroup1">
<RadioButton android:id="@+id/rad1"
android:text="Button1"
android:layout_width="105px"
android:layout_height="wrap_content"
android:textSize="13px"></RadioButton>
<RadioButton android:id="@+id/rad2"
android:text="Button2"
android:layout_width="105px"
android:textSize="13px"
android:layout_height="wrap_content"></RadioButton>
<RadioButton android:id="@+id/rad3"
android:text="Button3"
android:layout_width="105px"
android:textSize="13px"
android:layout_height="wrap_content"></RadioButton>
</RadioGroup>
</TableRow>
<TableRow>
<RadioGroup android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:id="@+id/radGroup1">
<!-- snippet -->
</TableRow>
<!-- snippet --->
</TableLayout>
Obviously I didn't learn the first time because I ran into a wall again. I was hoping that the radio buttons in different table rows would notice that they were part of the same radio group (gave each group the same ID) but this didn't work.
Is there any way I can group all of these buttons into a single radio group and still maintain my 3x3 structure (3 rows, 3 radio buttons in each row)?