在android程序中关闭软键盘

InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(editTextField.getWindowToken(), 0);



private void showSoftKey(View v) {
InputMethodManager adviseInputMethod = (InputMethodManager) v
.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
adviseInputMethod.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0);
}

你可能感兴趣的:(在android程序中关闭软键盘)