如何隐藏Android的软键盘?键盘、Android

由网友(开火车的男人)分享简介:我有两个EditText上的意见及的LinearLayout一个按钮。写作中的EditText完成后,我想隐藏Android的虚拟键盘,我该怎么办呢? I have two EditText Views and a Button in Linearlayout. After Completion of writing...

我有两个EditText上的意见及的LinearLayout一个按钮。写作中的EditText完成后,我想隐藏Android的虚拟键盘,我该怎么办呢?

I have two EditText Views and a Button in Linearlayout. After Completion of writing in the edittext, I want to hide the Android Virtual keyboard, How can I do that?

推荐答案

您可以使用InputMethodManager类是这样的:

You may use the InputMethodManager class like this:

InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow( yourEditText.getWindowToken(),InputMethodManager.RESULT_UNCHANGED_SHOWN);
阅读全文

相关推荐

最新文章