Any idea why this would crash my app when I select a radio button?
I\'ve imported android.widget.RadioGroup.OnCheckedChangeListener
, and I\'ve also trie
the problem you have is because of the onclick in your XML file so just delete the onclick in your XML attributes and implement onCheckedChangeListener like this:
priorRadioGroup=(RadioGroup)fragmentView.findViewById(R.id.priorityRadioGroup);
priorRadioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
switch(checkedId) {
//your code comes here
}
}
});
when you set onclick in Layout XML file it means you should have the method you called in activity class, and you don't. hope it helps.