How to open soft keyboard ontouchListener of EditText

I have an edittext to which I have assigned a touch listener. But when I touch the editText the soft keyboard does not pop up. I have used InputMethodManager manager=(InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); manager.showSoftInput(roomLnEditTxt, InputMethodManager.SHOW_IMPLICIT);

but still not working.


Use SHOW_FORCED instead of SHOW_IMPLICIT

InputMethodManager mgr = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); mgr.showSoftInput(YOUR_VIEW, InputMethodManager.SHOW_FORCED);

This will definitely solve your problem.


在清单中添加此行

<activity android:name=".activity" android:configChanges="keyboardHidden|orientation">
链接地址: http://www.djcxy.com/p/93440.html

上一篇: 仅通过后退按钮隐藏软键盘

下一篇: 如何打开EditText的软键盘ontouchListener