安卓收起软键盘
当我们在安卓输入框写完东西时,我们想让它自动收起软键盘,于是可以用下面的代码收起来,设计非常的银杏。
InputMethodManager manager = (InputMethodManager) getApplicationContext().getSystemService(Context.INPUT_METHOD_SERVICE);
if (manager != null)
manager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);