我如何才能知道键盘是否打开。实际上我的问题是如果键盘打开,那么我只会呼叫隐藏,而不是总是调用hide。有什么方法可以检查键盘是否打开?目前我正在使用这种方法来隐藏键盘。
EditText myEditText = (EditText) findViewById(R.id.myEditText);
View view = this.getCurrentFocus();
if (view != null) {ditText) findViewById(R.id.myEditText);
View view = this.getCurrentFocus();
if (view != null) { Inp`
im.hideSoftInputFromWindow(view.getWindowToken(), 0);