private void showKeyboard() { InputMethodManager imm = (InputMethodManager) this .getSystemService(Context.INPUT_METHOD_SERVICE); imm.toggleSoftInput(0, InputMethodManager.HIDE_NOT_ALWAYS);
//显示软键盘
imm.showSoftInput(editText, InputMethodManager.SHOW_IMPLICIT);
//隐藏软键盘
imm.hideSoftInputFromWindow(ediText.getWindowToken(),0);
/**
*xml中禁止软键盘弹出
* android:windowSoftInputMode="adjustUnspecified|stateHidden"
*/ }