如何打开EditText的软键盘ontouchListener
我有一个edittext,我已经为其指定了一个触摸监听器。 但是当我触摸editText时,软键盘不会弹出。 我使用了InputMethodManager manager =(InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); manager.showSoftInput(roomLnEditTxt,InputMethodManager.SHOW_IMPLICIT);
但仍然无法正常工作。
使用SHOW_FORCED而不是SHOW_IMPLICIT
InputMethodManager mgr =(InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); mgr.showSoftInput(YOUR_VIEW,InputMethodManager.SHOW_FORCED);
这一定会解决你的问题。
在清单中添加此行
<activity android:name=".activity" android:configChanges="keyboardHidden|orientation">
链接地址: http://www.djcxy.com/p/93439.html