My question is: How can I update the display of the action button of the soft keyboard on the fly?
Another post seems to be about changing the editor action BEFORE the keyboard is shown: Android: Can't figure how to use setImeActionLabel. I would like to change the soft keyboard action button WHILE it is shown.
I have partially succeeded: - I can change the action by using: editText.setImeOptions(EditorInfo.IME_ACTION_GO); - I can also redraw the keyboard using: InputMethodManager.restartInput(editText); I do this using TextWatcher.afterTextChanged. - However, I have a problem with this. If I press a key, on top of that the keyboard shows which key has been pressed. But when I call restartInput(...), this also hides the view that shows which key has been pressed. This seems normal behaviour to me, but I need a way around it.
Extending EditText and overriding onKeyUp is not a good idea, see: https://groups.google.com/forum/?fromgroups#!topic/android-developers/RIxGfx5qOjM.
The KeyboardView class has exactly what I need (invalidateKey), but I think that is only accessible when you create your own input method.
Anybody else have some better ideas?