Java OpenResty Spring Spring Boot MySQL Redis MongoDB PostgreSQL Linux Android Nginx 面试 小程序 Arthas JVM AQS juc Kubernetes Docker 诊断工具


Android 隐藏软键盘

Android 大约 323 字

隐藏软键盘

自定义view中在调用finish前调用此方法

Activity activity = (Activity) getContext();
InputMethodManager imm = (InputMethodManager)activity.getSystemService(Context.INPUT_METHOD_SERVICE);
if (imm.isActive()) {
    imm.hideSoftInputFromWindow(activity.getWindow().getDecorView().getWindowToken(),InputMethodManager.HIDE_NOT_ALWAYS);
}
阅读 1578 · 发布于 2019-04-13

————        END        ————

Give me a Star, Thanks:)

https://github.com/fendoudebb

扫描下方二维码关注公众号和小程序↓↓↓

扫描二维码关注我
昵称:
随便看看 换一批