始终隐藏虚拟键盘

sud*_*kar 2 android android-softkeyboard

实际上我有一个编辑文本.当我点击编辑文本虚拟键盘popups.But我只想隐藏虚拟键盘,即使点击编辑文本后.编辑文本应该可以打印系统键盘.我怎么能这样做?我的代码..

EditText edtNote = (EditText)findViewById(R.id.note);
InputMethodManager imm = (InputMethodManager) this.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.restartInput(edtNote);

Configuration config = this.getResources().getConfiguration();

if (config.hardKeyboardHidden == Configuration.HARDKEYBOARDHIDDEN_YES) {
    imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0);
}
Run Code Online (Sandbox Code Playgroud)

kar*_*ick 6

试试edtNote.setInputType(InputType.Type_Null); 它有优点和缺点.Android不会将元素视为输入元素.在此之后你不能输入任何东西