Dialog中隐藏软键盘

/**
  * Dialog中隐藏软键盘
  *
  * @param activity
  */
  public static void HideSoftKeyBoardDialog(Activity activity) {
      try {
          InputMethodManager imm = (InputMethodManager) activity.getSystemService(activity.INPUT_METHOD_SERVICE);
          imm.toggleSoftInput(InputMethodManager.HIDE_NOT_ALWAYS, 0);
      } catch (Exception ex) {


   }
}

你可能感兴趣的:(Dialog中隐藏软键盘)