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
Post a Comment