/**
* 隐藏软键盘
* @param view
*/
public static void hideKeyboard(View view){
InputMethodManager imm = (InputMethodManager) view.getContext()
.getSystemService(Context.INPUT_METHOD_SERVICE);
if (imm !=null) {
imm.hideSoftInputFromWindow(view.getWindowToken(),0);
}
}
/**
* 显示软键盘
* @param view
*/
public static void showKeyboard(View view) {
InputMethodManager imm = (InputMethodManager) view.getContext()
.getSystemService(Context.INPUT_METHOD_SERVICE);
if (imm !=null) {
view.requestFocus();
imm.showSoftInput(view, 0);
}
}










网友评论