i recently integrated butterknife in my android project, and now i am trying to use @OnCheckedChanged annotation for radiogroup. but getting error of not giving callback. So what is the right method to call and get checkedId or this one is for radiobutton only and not for radiogroup.
@OnCheckedChanged(R.id.gendergroupid)
void onGenderSelected(RadioGroup group, int checkedId){
switch(checkedId){
case R.id.maleid:
maleid.setEnabled(true);
maleid.setChecked(true);
break;
case R.id.femaleid:
femaleid.setEnabled(true);
femaleid.setChecked(true);
break;
case R.id.bothid:
bothid.setEnabled(true);
bothid.setChecked(true);
break;
}
}
Gives me error
BloError:(89, 10) error: Unable to match @OnCheckedChanged method arguments.
Parameter #1: android.widget.RadioGroup did not match any listener parameters
Parameter #2: int did not match any listener parameters
Methods may have up to 2 parameter(s):
android.widget.CompoundButton boolean
These may be listed in any order but will be searched for from top to bottom.ckquote