1
A
回答
0
我认为这是你在找什么,
EditText editText = (EditText) findViewById(R.id.myEdit);
InputMethodManager mgr = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
mgr.showSoftInput(editText, InputMethodManager.SHOW_IMPLICIT);
而再次关闭它:
InputMethodManager mgr = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
mgr.hideSoftInputFromWindow(editText.getWindowToken(), 0);
记住,软键盘将只显示在不具有设备物理键盘。
感谢詹姆斯,但是,我试图从TextView中触发此事件。可能吗? – emet 2011-05-10 10:44:16