【发布时间】:2018-11-20 15:32:40
【问题描述】:
正在开发一款教育类安卓应用。一个通过EditText 输入、单选按钮和CheckBox 提供答案。
我想检查RadioGroup,当没有点击RadioButton 时,它会提示学生并阻止提交。我在EditText 中成功了,但在RadioButton 中没有成功。
public void checkEmptyButtons(View view){
RadioGroup rg = (RadioGroup) findViewById(R.id.myRg);
if (rg.getCheckedRadioButton()==-1{
// this is where I have a problem
//I don't even know how to search on the //dev.anderoid site
}
}
这就是卡住的地方。提前致谢 .
【问题讨论】:
标签: android radio-group