I have a strange problem. I have an Android device with keyboard. And on some fragments we use softkeyboard for which we wait on Editor Action to close the keyboard and validate the input. For that reason we set on input text field the callback setOnEditorActionListener which on EditorInfo.IME_ACTION_DONE and KeyEvent.KEYCODE_ENTER validates the input.
Of course we also set setOnEditorActionListener to null once the validation is done.
This is working fine. What is not working fine that we have on our activity override for onKeyDown and before any use of setOnEditorActionListener KeyEvent.KEYCODE_ENTER always works as expected it is correctly propagated to this method. After we set setOnEditorActionListener with some custom callback KeyEvent.KEYCODE_ENTER is never again received in onKeyDown. All other keys are received just KeyEvent.KEYCODE_ENTER never.
Is this some kind of bug or are we clearing setOnEditorActionListener incorrectly with null or what?
Any idea? As a workaround for now I have done that once validation is done I set a flag and don't set setOnEditorActionListener to null any more but handle enter in the callback and propagate it by hand to onKeyDown. Of course this is not the way I want to do it.
Our min sdk is 25.