/**
* 隐藏输入法键盘
*
* @param activity
*/
public static void hideKeyboard(Activity activity) {
if (activity == null)
return;
View focusedView = activity.getCurrentFocus();
if (focusedView != null) {
InputMethodManager mm = ((InputMethodManager) activity.getSystemService(Context.INPUT_METHOD_SERVICE));
mm.hideSoftInputFromWindow(focusedView.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
}
}
Android隐藏输入法
最新推荐文章于 2023-11-03 10:27:39 发布