小编Lal*_*iya的帖子

在片段中隐藏键盘

我试图在活动中的片段内隐藏键盘时遇到这些错误:

错误:无法解析getSystemService

无法解析Context

无法解析getCurrentFocus()

 InputMethodManager inputManager = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
 inputManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(),
 InputMethodManager.HIDE_NOT_ALWAYS);
Run Code Online (Sandbox Code Playgroud)

keyboard android

6
推荐指数
1
解决办法
4777
查看次数

标签 统计

android ×1

keyboard ×1