Android 隐藏软键盘

Android About 323 words

隐藏软键盘

自定义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);
}
Views: 1,957 · Posted: 2019-04-13

————        END        ————

Give me a Star, Thanks:)

https://github.com/fendoudebb/LiteNote

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

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


Today On History
Browsing Refresh