以下是我的代码
{{1}}
答案 0 :(得分:-1)
如果要允许2个或更多空格,只需在末尾或空格radiogroup.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
// Radio button
RadioButton rb1=(RadioButton)findViewById(R.id.rdb1);
if (rb1.isChecked()){
Toast.makeText(MainActivity.this, "1 option selected", Toast.LENGTH_LONG).show();
}
else{
Toast.makeText(MainActivity.this, "2 option selected", Toast.LENGTH_LONG).show();
}
}
});
中添加空格:
+