Android的解雇键盘

问题描述:

我如何关闭键盘时,按钮是pressed?

How do I disable the keyboard when a button is pressed?

您希望禁用或驳回的虚拟键盘?

You want to disable or dismiss a virtual Keyboard?

如果您只想关闭它,你可以用code以下线在按钮的点击事件

If you want to just dismiss it you can use the following lines of code in your button's on click Event

InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(myEditText.getWindowToken(), 0);