Android RadioButton not able to unset using setChecked(false) method

假如想象 提交于 2019-12-02 22:15:24

I found the solution.

It is not possible to uncheck a particular radio button. You can only set the other item to true.

So to clear all the checked items, you should call the clearcheck() method on the RadioGroup.

So my else part is

        else {
            ((RadioGroup) findViewById(R.id.ID0)).clearCheck();
        }

Take one invisible radio button and check it. All other radio buttons of group will be unchecked automatically..

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!