隐藏虚拟键盘,当点击一个按钮 [英] Hide virtual keyboard when click a button
本文介绍了隐藏虚拟键盘,当点击一个按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有一种方法可以隐藏虚拟键盘当我点击Android的一个按钮?键盘最初弹出当用户触摸一个EditText分量;我想它关闭,一旦一个按钮被按下。
Is there a way to hide the virtual keyboard once I click a button in android? The keyboard originally pops up when the user touches an edittext component; I'd like it to close once a button is pushed.
推荐答案
要隐藏虚拟键盘尝试/使用此
To hide virtual keyboard try/use this
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(medtSearchQuery.getWindowToken(), 0);
这篇关于隐藏虚拟键盘,当点击一个按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文