I have an Edittext with imeoptions
asactiongo
. and I triggered my event when pressing soft keyboard enter button.
mModelId.setOnE
I've checked at Android 2.1 and Android 4.0 versions and your code is working fine. IME_ACTION_GO
event is reported in case EditText has singleLine
option specified to true
. In case it is specified to false
actionId
has IME_NULL
value independently of the setImeActionLabel
was called or no.
In the TextView.onKeyDown method i've found that IME_NULL
actionId is used when KEYCODE_ENTER
is detected
mEditor.mInputContentType.onEditorActionListener.onEditorAction(
this, EditorInfo.IME_NULL, event))
Perhaps it is custom keyboard issue. Do you use any? If so try these changes:
instead of
mModelId.setImeActionLabel("Search Model", KeyEvent.KEYCODE_ENTER);
should be
mModelId.setImeActionLabel("Search Model", EditorInfo.IME_ACTION_GO);