在radiogroup中有三個radiobuttons,我使用Java如何實現(xiàn)不同按鈕被選中會發(fā)生不同的動作?下面是關于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實現(xiàn)按鈕被選中后發(fā)生動作的功能?
添加回答
舉報
0/150
提交
取消