我有一个显示视图的活动。该视图由各种小部件组成,其中之一是多行 EditText。当视图膨胀时,软键盘出现我如何禁用它?
我尝试过的事情:
从 EditText 中的布局中删除以下内容。
<requestFocus />
.
创建以下方法,然后从 oncreate 方法调用它(分辨率为 EditText)。
private void hideSoftKeyboard() {
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(resolution.getWindowToken(), 0);
}