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

Popular posts from this blog

javascript - oscilloscope of speaker input stops rendering after a few seconds -

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -