只需在空白的LinearLayout添加点击事件即可,
点击事件的内容:
/*
* 处理键盘
*/
private void dealwithHiddenInputKeyBoard() {
InputMethodManager inputManager = (InputMethodManager) BookSearchActivity.this
.getSystemService(Context.INPUT_METHOD_SERVICE);
// check if no view has focus:
View view = BookSearchActivity.this.getCurrentFocus();
if (view != null) {
inputManager.hideSoftInputFromWindow(view.getWindowToken(),
InputMethodManager.HIDE_NOT_ALWAYS);
}
}
亲测成功。