radiogroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
void onCheckedChanged(RadioGroup rg, int checkedId) {
for(int i=0; i<rg.getChildCount(); i++) {
RadioButton btn = (RadioButton) rg.getChildAt(i);
if(btn.getId()==(checkedId) {
String text = btn.getText();
// do something with text
return;
}
}
}
});
radiogroup判断选择的单个选项
最新推荐文章于 2023-04-09 21:06:40 发布