How to hide Android Soft Keyboard? [duplicate]

天涯浪子 提交于 2019-12-02 23:52:02

问题


I have two EditText Views and a Button in Linearlayout. After Completion of writing in the edittext, I want to hide the Android Virtual keyboard, How can I do that?


回答1:


You may use the InputMethodManager class like this:

InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow( yourEditText.getWindowToken(),InputMethodManager.RESULT_UNCHANGED_SHOWN);


来源:https://stackoverflow.com/questions/22404302/how-to-hide-android-soft-keyboard

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!