【发布时间】:2011-01-29 20:25:08
【问题描述】:
实际上我有一个编辑文本。当我单击编辑文本虚拟键盘弹出窗口时。但我只想在单击编辑文本后始终隐藏虚拟键盘。编辑文本应该可以使用系统键盘打印。我该怎么做? 我的代码..
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);
}
【问题讨论】:
-
你试过了吗 EditText.setInputType(InputType.TYPE_NULL);
-
我应该在哪里插入该代码?
-
感谢 karthick。它现在正在工作...
-
接受我的回答老兄...
标签: android android-softkeyboard