1、隐藏软键盘
1 private void hideSoftInput(){ 2 // 隐藏软键盘 3 InputMethodManager inputManager = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE); 4 if (inputManager != null && getActivity().getCurrentFocus()!=null) { 5 inputManager.hideSoftInputFromWindow(getActivity().getCurrentFocus().getWindowToken(), 6 InputMethodManager.HIDE_NOT_ALWAYS); 7 } 8 }
时间: 2024-10-20 03:46:56