如何打开的EditText的软键盘ontouchListener

问题描述:

我有一个EditText,而我已经分配了一个触摸监听器。但是,当我触碰EDITTEXT软键盘不会弹出。我已经使用
InputMethodManager经理=(InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
                        manager.showSoftInput(roomLnEditTxt,InputMethodManager.SHOW_IMPLICIT);

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);

但仍然没有工作。

使用SHOW_FORCED代替SHOW_IMPLICIT

Use SHOW_FORCED instead of SHOW_IMPLICIT

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

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

这肯定会解决你的问题。

This will definitely solve your problem.