您的位置:首页 > 移动开发 > Android开发

Android keyboard hide and show

2014-08-22 11:45 316 查看
Show

EditText editText = (EditText)findViewById(R.id.myEdit);
InputMethodManager mgr = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
// only will trigger it if no physical keyboard is open
mgr.showSoftInput(editText,InputMethodManager.SHOW_IMPLICIT);


And to hide:

InputMethodManager mgr =(InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
mgr.hideSoftInputFromWindow(editText.getWindowToken(), 0);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: