
January 6th, 2013, 01:07 AM
|
|
Registered User
|
|
Join Date: Jan 2013
Posts: 2
Time spent in forums: 33 m 20 sec
Reputation Power: 0
|
|
Quote: | Originally Posted by Edu Varta Hi,
I am trying to implement the logic for radio button group but it is not working. I want it to work like...
If radio button1 is selected and submit is clicked, activity1 is seen and if radio button2 is selected and submit is clicked, activity2 is seen.
can any one help me plz? |
Make onClick listener for each radio button on Radio Group
PHP Code:
public void onRadioButtonClicked(View view) {
// Is the button now checked?
boolean checked = ((RadioButton) view).isChecked();
// Check which radio button was clicked
switch(view.getId()) {
case R.id.radio0:
if (checked)
// start your activity 1 here
break;
case R.id.radio1:
if (checked)
// start your activity 2 here
break;
}
}
|