I found a way that works for me to keep the soft keyboard visible after editing in my myEditText field of the myEditText class. The trick is to override the onEditorAction method onEditorAction that it returns true
myEditText.setOnEditorActionListener(new OnEditorActionListener() { @Override public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { return true; } });
or else onEditorAction return true only after pressing the "Finish" key ( IME_ACTION_DONE ), otherwise false
myEditText.setOnEditorActionListener(new OnEditorActionListener() { @Override public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { if(actionId==EditorInfo.IME_ACTION_DONE){ Log.i(LOG_TAG, "IME_ACTION_DONE"); return true; } return false; } });
(see also this answer on the onEditorAction method)
Adding android:windowSoftInputMode="stateAlwaysVisible to the manifest file helped to display a soft keyboard at the start of the activity, but this did not stop it from disappearing again whenever after clicking the" Finish "button it was pressed after editing.
user2314737 Feb 18 '14 at 18:26 2014-02-18 18:26
source share