Android关闭输入法
16lz
2021-12-04
/** * 关闭输入法 * @author YOLANDA * @param context */public static void closeInputMethod(Activity context){InputMethodManager inputMethodManager = (InputMethodManager)context.getSystemService(Context.INPUT_METHOD_SERVICE);View focusView = context.getCurrentFocus();if(inputMethodManager != null && focusView != null){inputMethodManager.hideSoftInputFromWindow(focusView.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);}}
更多相关文章
- android 开发之Activity切换
- Android(安卓)WiFi管理(WIFI_SERVICE)
- android camera2 api点击图片实现聚焦
- android camera2 api点击图片实现聚焦
- Android与服务器通信的方法之一-->TCP
- android 开发之Activity切换
- android软键盘开关
- Activity has leaked window that was originally added 问题解
- Android(安卓)关闭(删除)FM Transmitter功能的方法