Radio group onclick event not firing, how do I tell which is selected?(单选组 onclick 事件未触发,我如何判断哪个被选中?)
问题描述
我正在使用无线电组,但 RadioGroup
onClick
事件未触发并且getCheckedRadiobuttonID()
方法返回 null
.这是我的布局中的元素:
I'm using radio group but RadioGroup
onClick
event is not firing and
the method getCheckedRadiobuttonID()
is returning null
. Here is the element in my layout:
方法
推荐答案
这个问题可以用下面的方法解决
This problem can be solved using the following
或者
您可以使用自定义 ID 而不是默认 ID
Alternatively
You can use custom ids rather than default one
这篇关于单选组 onclick 事件未触发,我如何判断哪个被选中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!