How to select a single checkbox while disabling clickable option in other checkbox if i have two checkboxes in android? -


i have 2 checkboxes yes or no options.i have select 1 option while disabling clickable option of other checkbox. opp11 , op12 2 checkboxes.the following code seems work if have around 20 checkbox options.is there method shorten code can pass 2 options 1 set onchanged listner , other disable clickable option.

op11.setoncheckedchangelistener(new compoundbutton.oncheckedchangelistener(){          @override         public void oncheckedchanged(compoundbutton buttonview,         boolean ischecked) {         if(ischecked){             op12.setchecked(false);             // code display message.             }         }     }); 


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -