android 判断输入法是否打开


if (getActivity().getWindow().getAttributes().softInputMode == WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE) {
   InputMethodManager imm = (InputMethodManager) getActivity().getApplicationContext() .getSystemService(Context.INPUT_METHOD_SERVICE);
   imm.toggleSoftInput(0, InputMethodManager.HIDE_NOT_ALWAYS);
  }

猜你喜欢

转载自blog.csdn.net/u013209460/article/details/45310015