Я хочу сделать новое действие, например, подтвердить, какой переключатель отмечен.
- У меня есть 2 радио-группы
- В каждой группе не менее 10 переключателей
- Я хочу использовать любое значение радио-кнопки для следующего действия
и наверняка из каждой радиогруппы можно выбрать только одну радиокнопку
Вот мой код xml, и я хочу код Java
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="391dp"
android:orientation="vertical" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Where Are You" />
<RadioGroup
android:id="@+id/radioGroup0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scrollbarStyle="insideOverlay"
android:scrollbars="vertical" >
<RadioButton
android:id="@+id/radio0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="it" />
<RadioButton
android:id="@+id/radio1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Eng" />
<RadioButton
android:id="@+id/radio2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="there" />
<RadioButton
android:id="@+id/radio3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="it" />
<RadioButton
android:id="@+id/radio4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Eng" />
<RadioButton
android:id="@+id/radio5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="there" />
<RadioButton
android:id="@+id/radio6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="it" />
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Where Do You Want To Go" />
<RadioGroup
android:id="@+id/radioGroup1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scrollbarStyle="insideOverlay"
android:scrollbars="vertical" >
<RadioButton
android:id="@+id/radio12"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="it" />
<RadioButton
android:id="@+id/radio13"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Eng" />
<RadioButton
android:id="@+id/radio14"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="there" />
<RadioButton
android:id="@+id/radio15"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="it" />
<RadioButton
android:id="@+id/radio16"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Eng" />
<RadioButton
android:id="@+id/radio17"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="there" />
</RadioGroup>
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="OK" />
</LinearLayout>
</ScrollView>
Я удалил некоторые радио-кнопки, так что это не займет много времени.
Обратите внимание, я новичок.
RadioButton
в строке... это перебор. Как насчет одного выбораListView
илиSpinner
? - person S.D.   schedule 05.11.2012ListView
или 2Spinner
в одном макете. - person S.D.   schedule 06.11.2012