Android 切换软键盘 以及关闭
private void toggleInput(Context context){
InputMethodManager inputMethodManager =
(InputMethodManager)context.getSystemService(Context.INPUT_METHOD_SERVICE);
inputMethodManager.toggleSoftInput(0, InputMethodManager.HIDE_NOT_ALWAYS);
}
切换软键盘
private void hideInput(Context context,View view){
InputMethodManager inputMethodManager =
(InputMethodManager)context.getSystemService(Context.INPUT_METHOD_SERVICE);
inputMethodManager.hideSoftInputFromWindow(view.getWindowToken(), 0);
}
隐藏软键盘