Android Focus issue between EditText and CheckBox -
i have edittext field , checkbox. behavior looking 'one or other should valid'. (1) if there's text in edittext , if user clicks checkbox, edittext field should automatically set "". code if checkbox.ischecked() edittext.settext(""), , works expected.
(2) likewise, if checkbox checked , if user starts entering text in edittext, checkbox needs unchecked. code on edittext..aftertextchanged listener, if checkbox.ischecked() checkbox.toggle(). sort of seems happen, edittext field doesn't let go of focus. next time, try click checkbox (#1), edittext receives focus first though clicked checkbox, , clears checkbox, never able check checkbox, because edittext keeps receiving focus , keeps unchecking checkbox.
is there anyway make happen? please let me know. thanks.
Comments
Post a Comment