2011-01-29 89 views
2

其实我编辑text.when我点击编辑文本虚拟键盘popups.But我只是想隐藏虚拟键盘总是即使点击后编辑text.And编辑文本应与系统keyboard.How可打印我这样做? 我的代码..隐藏虚拟键盘总是

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); 
} 
+0

你试过EditText.setInputType(InputType.TYPE_NULL); – karthick 2011-01-29 12:21:57

回答

6

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