在radiogroup中有三个radiobuttons,我使用Java如何实现不同按钮被选中会发生不同的动作?下面是关于radiogroup和radiobutton的代码:final RadioGroup size = (RadioGroup)findViewById(R.id.RGSize);
final RadioButton small = (RadioButton)findViewById(R.id.RBS);
final RadioButton medium = (RadioButton)findViewById(R.id.RBM);
final RadioButton large = (RadioButton)findViewById(R.id.RBL);
if (size.getCheckedRadioButtonId().equals(small){
} else{
}但是equals不是正确的语法。如何用Java实现按钮被选中后发生动作的功能?
添加回答
举报
0/150
提交
取消