How to check state Changing of CheckBox in android? -
i want check if checkboxes checked change values. got answer radiobutton inserted radiogroup , can use :
radiogroup.setoncheckedchangelistener(new new oncheckedchangelistener(){ @override public void oncheckedchanged(radiogroup group, int checkedid) { . . . } }
i'm looking ,however approach differ checkboxes because there no widget checkboxgroup use setoncheckedchangelistener on .
for example have checkbox1 , checkbox2. how can long these 2 checkboxes checked changing value :
if(checkbox1==ischecked && checkbox2==ischecked) //do sth ... else //do sth different
edit : maybe not explain problem , question below checkboxes how check state changing of radio button android?
as commented can use checkboxref.ischecked()
if(checkbox1.ischecked() && checkbox2.ischecked()){ } else{ }
but want use them in different function , may globally access checkboxes
you can use sharedpreference
, utility class store state of checkbox.
Comments
Post a Comment