Im newbiew to programming, i want create some quiz app. all the answer just use radio button user must choose : 1 or 2 or 3 or 4, all the question have same radiobutton text, the answer just from 1 to 4. i already read how to loop dynamic just radiobutton but how to loop RadioGroup because i just need the number for each question and insert into array,
this is my xml :
<RadioGroup
android:id="@+id/radioGroup1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<RadioButton
android:id="@+id/radio0"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="12sp"
android:textColor="@color/black"
android:text="0"
android:button="@null"
android:drawableTop="@android:drawable/btn_radio"
android:gravity="center"
android:layout_weight="1"/>
<RadioButton
android:id="@+id/radio1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="12sp"
android:textColor="@color/black"
android:text="1"
android:button="@null"
android:drawableTop="@android:drawable/btn_radio"
android:gravity="center"
android:layout_weight="1"/>
<RadioButton
android:id="@+id/radio2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="12sp"
android:textColor="@color/black"
android:text="2"
android:button="@null"
android:drawableTop="@android:drawable/btn_radio"
android:gravity="center"
android:layout_weight="1"/>
<RadioButton
android:id="@+id/radio3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="12sp"
android:textColor="@color/black"
android:text="3"
android:button="@null"
android:drawableTop="@android:drawable/btn_radio"
android:gravity="center"
android:layout_weight="1" />
</RadioGroup>
and this is the result : http://tinypic.com/r/2uzs50g/8
i thought if i can just loop radiogroup dynamic with same radiobutton for each question i can just get radiogroup id and insert into array. if you have other sugestion how i should create something like that please tell. thanks for your help all