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判断选择的单个选项
最新推荐文章于 2024-06-16 17:53:48 发布
本文详细介绍了如何实现自定义RadioButton群组的监听器,包括如何获取被选中按钮的文本,并进行相应的操作。
1546

被折叠的 条评论
为什么被折叠?



