android关闭软键盘

2016-06-19  本文已影响0人  梦沉薇露
  
private void hintKeyboard() {  
 InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);              
 if(imm.isActive()&&getCurrentFocus()!=null){  
    if (getCurrentFocus().getWindowToken()!=null) {  
    imm.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);  
    }               
 }  
}  
上一篇 下一篇

猜你喜欢

热点阅读