public void dismissKeyboard(Activity activity) {
InputMethodManager imm = (InputMethodManager) activity.getSystemService(Context.INPUT_METHOD_SERVICE);
if (null != activity.getCurrentFocus())
imm.hideSoftInputFromWindow(activity.getCurrentFocus()
.getApplicationWindowToken(), 0);
}
Run Code Online (Sandbox Code Playgroud)
活动必须传递给此方法,键盘将被解雇.
| 归档时间: |
|
| 查看次数: |
8805 次 |
| 最近记录: |