How to ensure that no two checkboxes are enabled in android -


i have custom list view , each item of has check box , text field. want disable check box in every other row of list view if check box of first row enabled.

since stating if first check box clicked others should disabled, check in onbindview() see if checkbox checked. if is, set value is, , following list view entries set checkbox disabled.

in oncheckchangedlistener():

 checkbox1.setoncheckedchangelistener(new compoundbutton.oncheckedchangelistener() {          @override         public void oncheckedchanged(compoundbutton buttonview, boolean ischecked) {             if(ischecked()){                 firstcheckboxchecked = true;             }     }); 

then in onbindview rest:

if(firstcheckboxchecked){     checkbox.setenabled(false); } 

Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -