1 InputMethodManager imm =
(InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
2 imm.toggleSoftInput(0, InputMethodManager.HIDE_NOT_ALWAYS);
显示则隐藏 隐藏则显示
1 InputMethodManager imm =
(InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
2 if (imm.isActive()) {
3 imm.hideSoftInputFromWindow(getWindow().getDecorView()
4 .getWindowToken(), 0
);
5 }
显示的时候隐藏
转载于:https://www.cnblogs.com/YyuTtian/p/5383700.html