/**
* 隐藏软键盘
* @param context
*/
public void hideInputWindow(Activity context){
if(context==null){
return;
}
//判断软键盘是否开启
final View v = ((Activity) context).getWindow().peekDecorView();
if (v != null && v.getWindowToken() != null) {
InputMethodManager imm = (InputMethodManager) context.getSystemService(context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(v.getWindowToken(), 0);
}
}
Android 开发之路 ----------- 软键盘隐藏与弹出
猜你喜欢
转载自blog.csdn.net/z1455841095/article/details/107788697
今日推荐
周排行