本文共 534 字,大约阅读时间需要 1 分钟。
- InputMethodManager manager manager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
-
-
-
-
- @Override
- public boolean onTouchEvent(MotionEvent event) {
-
- if(event.getAction() == MotionEvent.ACTION_DOWN){
- if(getCurrentFocus()!=null && getCurrentFocus().getWindowToken()!=null){
- manager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
- }
- }
- return super.onTouchEvent(event);
- }
转载于:https://www.cnblogs.com/hexihexi/p/6140619.html