Android Radio Button doesn't get checked sometimes
-
26-09-2019 - |
Question
I have 4 RadioButton
s in a RadioGroup
. The RadioButton
s have the same instance of OnCheckedChangedListener
set. When any of the RadioButton
is selected a dialog is popped up after 800ms using a handler. The problem is, sometimes any of the RadioButton
s remains unchecked even after the checked state is changed, but the dialog pops up. I suspect this to be a bug. Any pointers will be greatly appreciated.
Solution
Instead of calling RadioButton.setChecked()
for every individual instance I called RadioGroup.clearChecked()
, this seemed to solve my problem.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow