我想隐藏键盘:
View view = this.getCurrentFocus();
if (view != null) {
InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
}
}
});
现在我遇到了问题,它getCurrentFocus
被getSystemService
涂成红色,上面写着:
Cannot resolve method getCurrentFocus() / getSystemService()
我究竟做错了什么?
谢谢你的帮助!