1 If the activity page has edittext, in order not to affect the user experience, we need to enter the page without popping the soft keyboard. How to set it up?
When you configure activity in the Mainifest.xml file, you can set these two sentences:
Android:configchanges= "Orientation|keyboardhidden" android:windowsoftinputmode= "AdjustUnspecified|stateHidden"
2 If there is a edittext in the dialog box, when the input is complete, the soft keyboard is automatically hidden so that no more "OK", the black screen area appears in the keyboard area.
Hide IME public void Closesoftkeboard (EditText edit) { Inputmethodmanager Inputmethodmanager = ( Inputmethodmanager) getactivity (). Getsystemservice (Context.input_method_service); Inputmethodmanager.hidesoftinputfromwindow (Edit.getwindowtoken () , 0); }
Edit.addtextchangedlistener (New Textwatcher () {@Overridepublic void ontextchanged (charsequence s, int start, int before , int count) {} @Overridepublic void beforetextchanged (charsequence s, int start, int count,int after) {} @Overridepublic Vo ID aftertextchanged (Editable s) {if (s.tostring (). Length () ==11) {Closesoftkeboard (edit);}});
Android Hidden Input Keyboard