I\'m writing an Activity
in android where I have two radio buttons under a RadioGroup. One of them is checked by default. But I can\'t trigger the event in
radioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
if (checkedId == R.id.radioButton1) {
//do work when radioButton1 is active
} else if (checkedId == R.id.radioButton2) {
//do work when radioButton2 is active
} else if (checkedId == R.id.radioButton3) {
//do work when radioButton3 is active
}
}
});
this work for me . hope is helpfull