Thursday, 15 August 2013

java - Checkbox - Firing event on checked -



java - Checkbox - Firing event on checked -

i'm using next check when checkbox clicked, if textbox empty, pre populate text. works if theres in checkbox, if when theres nil in checkbox, doesn't nail either else , can't quite work out why.

here's have:

final checkbox cbzone = (checkbox) dialog.findviewbyid(r.id.cbzone); cbzone.setoncheckedchangelistener(new oncheckedchangelistener() { @override public void oncheckedchanged(compoundbutton arg0, boolean arg1) { if(arg1){ if(txtname == null || txtname.gettext().equals("")){ log.e("checkbox", "empty"); } else { log.e("checkbox", "full"); } } } });

any help appreciated. thanks

java android checkbox

No comments:

Post a Comment