我需要隐藏软键盘以响应点击按钮。 我看到了有关这一些帖子,我有尝试过:Android:隐藏软输入键盘
InputMethodManager im = (InputMethodManager) getSystemService(
Context.INPUT_METHOD_SERVICE);
im.hideSoftInputFromWindow(myEditText1.getWindowToken(), 0);
运作良好。但是现在我有两个EditText视图。现在我怎么能隐藏软键盘,无论EditText选择了什么?我试了一下还与
InputMethodManager im = (InputMethodManager) getSystemService(
Context.INPUT_METHOD_SERVICE);
im.hideSoftInputFromWindow(myEditText1.getWindowToken(), 0);
im.hideSoftInputFromWindow(myEditText2.getWindowToken(), 0);
,但没有工作......
感谢您的帮助!
编辑: 找到解决办法。在下面发布。
哦,很高兴知道,谢谢! – marius