android 隐藏系统键盘


//第一种方式

InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); 

imm.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0);


//第二种方式隐藏软键盘-可行 
int flags = WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM; 
getWindow().addFlags(flags);  

猜你喜欢

转载自blog.csdn.net/weiqingsong150/article/details/51657135