/**
* 显示隐藏键盘
*
* @param show
*/
InputMethodManager imm1;
private void managerInput(int show) {
imm1 = (InputMethodManager) getSystemService(this.INPUT_METHOD_SERVICE);
if (show == 0) {
imm1.hideSoftInputFromWindow(et_chat_content.getWindowToken(), 0); // 隐藏软键盘
}else if (show == 1){
imm1.showSoftInput(et_chat_content, InputMethodManager.SHOW_FORCED);// 显示软键盘
}
}
关键:hideSoftInputFromWindow(et_chat_content.getWindowToken(), 0); // 隐藏软键盘 et_chat_content为EditText 控件。