rGroup = (RadioGroup)findViewById(R.id.radioGroup);
rGroup.setOnCheckedChangeListener(new OnCheckedChangeListener() {
public void onCheckedChanged(RadioGroup group, int checkedId) {
Toast.makeText(cont, checkedId, Toast.LENGTH_SHORT).show();
}
});
in these code above, i'm trying to get what the user clicks on the radio group,
i shouldn't use onClicklistener right?
You get checkedId as parameter. This is the the id of the checked radio button. You can pass this value to findViewById to get the RadioButton object.
ReplyDelete