How to hide Android Soft Keyboard? [duplicate]
问题 This question already has answers here : How to set visibility Android Soft Keyboard (97 answers) Closed 5 years ago . 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()