Android radio button cant uncheck -


i need have single radiobutton can check , uncheck.

but readings on stack overflow, radio button stay checked once checked on option needs selected?

here code far:

            radiobutton rbutton = new radiobutton(getactivity());             rbutton.settext(listitems.get(i));             rbutton.setid(i);             rbutton.setchecked(false);             rbutton.setclickable(true);             // rbutton.setonclicklistener(new view.onclicklistener() {             // @override             // public void onclick(view v) {             // radiobutton rbutton = (radiobutton)             // layout.findviewbyid(position);             // rbutton.setchecked(!rbutton.ischecked());             // }             // });                           layout.addview(rbutton); 

it work commented out onclick listener.

how can radio button uncheck?

i think need checkbox instead.


Comments

Popular posts from this blog

c++ - CryptStringToBinary API behavior -

c++ - Correct method for redrawing a layered window -

java.util.scanner - How to read and add only numbers to array from a text file -