I'm having problem when I use view flipper to show different xml and each of the xml contains radio button. So actually im in 2 situation I just need either way to work. Situation 1:
I need a 2 by 2 radio button which mean a total of 4 radio button in the position of 2 by 2 and im required to select 1 of them and the other 3 remain unchecked. my question is how can I create in xml that my radio button is all in the same group although somehow I manage to create a 4 radio button they all would not be categories into the same group. Any1 can give me an idea how to categories them into 1 radio group?
Codes:
<RadioGroup
android:id="@+id/rg1"
android:layout_height="0dp"
android:layout_width="fill_parent"
android:baselineAligned="false"
android:layout_weight="2.5"
android:orientation="horizontal">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:layout_weight="1">
<RadioButton
android:id="@+id/radio0"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:checked="true"
android:text="@string/radio1"
android:textColor="#000000"
android:button="@drawable/radiobutton"
android:clickable="true"
android:layout_weight="1"
android:paddingLeft="45dp"/>
<RadioButton
android:id="@+id/radio1"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:text="@string/radio2"
android:textColor="#000000"
android:button="@drawable/radiobutton"
android:clickable="true"
android:layout_weight="1"
android:paddingLeft="45dp"/>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:layout_weight="1">
<RadioButton
android:id="@+id/radio2"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:text="@string/radio3"
android:textColor="#000000"
android:button="@drawable/radiobutton"
android:clickable="true"
android:layout_weight="1"
android:paddingLeft="45dp"/>
<RadioButton
android:id="@+id/radio3"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:text="@string/radio4"
android:textColor="#000000"
android:button="@drawable/radiobutton"
android:clickable="true"
android:layout_weight="1"
android:paddingLeft="45dp"/>
</LinearLayout>
</RadioGroup>
Situation 2:
The second Situation is that I try clearing the radio buttons using codes nut somehow when I flip to another xml with the same radio button and id but it wont work.
PS: Sorry for my bad command of english