Short version of question: how can I capture long press event on soft input/keyboard in Android?
Long version: In an Android app, we have a multi-line EditText, and we want to have this behavior: 1. By default, it's showing a DONE button, by tapping it, soft input/keyboard will be closed. 2. If user long press the DONE button, its behavior will be changed to ENTER button, and there will have a new line in the EditText.
For requirement #1, I used the solution in here: https://mcmap.net/q/65745/-multiline-edittext-with-done-softinput-action-label-on-2-3
For requirement #2, the blocking question I have is, how to capture the long press event. I set the onEditorActionListener, but the captured event is null: http://developer.android.com/reference/android/widget/TextView.OnEditorActionListener.html I searched the document, the long press related method is for hard keyboard: http://developer.android.com/reference/android/view/View.html#onKeyLongPress(int, android.view.KeyEvent), I can't find one for soft input/keyboard.
Thanks for looking into this question.
doneButton.setOnLongClickListener(new OnLongClickListener() {...});
– Conciliatory