Now there is a need to say that you want to be able to automatically hide and open the soft keyboard, the scene is used in alert dialog has a text box, pop-up dialog at the same time automatically eject the keyboard, edit and click Finish to close directly. It is used in the following ways:
Inputmanager.showsoftinput (Tveditor, inputmethodmanager.show_forced);
If you use the parameter inputmethodmanager.show_implicit, you will not automatically eject the keyboard, but you cannot automatically turn off the keyboard after using show_forced, and you must press the back key.
Many of the auto-hide keyboard methods in vivo are OK, but Samsung does not have a way to do so, including not limited to the following ways:
(1) inputmanager.togglesoftinput (inputmethodmanager.show_implicit,inputmethodmanager.hide_implicit_only);
(2) Dialog.getwindow (). Setsoftinputmode (WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
(3) Dialog.getwindow (). Setsoftinputmode (WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
(4) Inputmanager.hidesoftinputfrominputmethod (Tveditor.getwindowtoken (), 0);
(5) Inputmanager.hidesoftinputfrominputmethod (Dialog.getwindow (). Getdecorview (). Getwindowtoken (), 0);
Finally inadvertently Google to, as long as the toggle to use the OK, and then display the use
Inputmanager.togglesoftinput (inputmethodmanager.show_forced, 0);
Hide also use
Inputmanager.togglesoftinput (inputmethodmanager.show_forced, 0);
Currently testing Samsung and Vivo are OK.
Android automatically turns on and off the soft keyboard