/** * Click on the blank area to hide the keyboard. * @param event The event * @return true if successful */@Overridepublic Boolean ontouchevent (Motionevent event) {Inputmet Hodmanager IMM = (inputmethodmanager) getsystemservice (Context.input_method_service); if (event.getaction () = = Motionevent.action_down) {if (EBDocuSearchActivity.this.getCurrentFocus () = null) {if ( EBDocuSearchActivity.this.getCurrentFocus (). Getwindowtoken ()! = null) {Imm.hidesoftinputfromwindow ( EBDocuSearchActivity.this.getCurrentFocus (). Getwindowtoken (), inputmethodmanager.hide_not_always);}} Return Super.ontouchevent (event);}
/** hidden keyboard */protected void Hideinputkeyboard (View v) {Inputmethodmanager Imm = (inputmethodmanager) getsystemservice ( Context.input_method_service); Imm.hidesoftinputfromwindow (V.getwindowtoken (), 0);} /** play keyboard */protected void Showinputkeyboard (View v) {Inputmethodmanager Imm = (inputmethodmanager) getsystemservice ( Context.input_method_service); Imm.showsoftinput (v, 0);}
"Android" memo knowledge points such as: Click on the blank area to hide the keyboard