i am new to android programming. I am trying to write my code so that the user makes a selection out of two radio buttons then clicks a “next” button. The next button then takes the user to one of two pages based on which radio button was selected.
<RadioGroup
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<RadioButton
android:id="@+id/Yes"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Yes" />
<RadioButton
android:id="@+id/No"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="No" />
</RadioGroup>
<Button
android:id="@+id/Next"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Next" />
–
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.mainpage);
}
I have looked around and found nothing answering this problem.
Any help will be appreciated. Thanks in advance.
// in Button onClick()
hope this helps..