How can I uncheck or reset the radio button?

后端 未结 3 914
我在风中等你
我在风中等你 2021-02-11 16:58

I am developing an quiz based app. There will be 1 question and 4 option (radio buttons) when user opens this app radio button will be unchecked but the problem comes when the u

3条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-11 17:53

    if the Radiobutton belong to a radiogroup you can NEVER unchecked alone that button programaticaly, so you must to do a method to unched all first.

        public void unchecked()
         {
         RadioGroup x=findViewById(R.id.NameOfRadiogroup);
         x.clearCheck();
         }  
    

    and then you must to call the method.

提交回复
热议问题