这两段代码都是网上找的,控制输入法,显示和隐藏的,先保持下来
((InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE)).toggleSoftInput(0, InputMethodManager.SHOW_IMPLICIT);
View view = getWindow().peekDecorView();
if (view != null) {
InputMethodManager inputmanger = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
inputmanger.hideSoftInputFromWindow(view.getWindowToken(), 0);
}
if (LoadingActivity.this.getCurrentFocus() != null) {
if (LoadingActivity.this.getCurrentFocus().getWindowToken() != null) {
imm.hideSoftInputFromWindow(LoadingActivity.this.getCurrentFocus().getWindowToken(),
InputMethodManager.HIDE_NOT_ALWAYS);
}
}