【Android】隐藏输入法
时间:2014-07-11 21:47:04
收藏:0
阅读:173
1 if (activity != null && activity.getCurrentFocus() != null 2 && activity.getCurrentFocus().getWindowToken() != null) { 3 InputMethodManager input = ((InputMethodManager) activity 4 .getSystemService(Activity.INPUT_METHOD_SERVICE)); 5 input.hideSoftInputFromWindow(activity.getCurrentFocus() 6 .getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS); 7 }
pop出现之前,将未收回的输入法主动隐藏。
评论(0)