Import Android.content.context;import Android.view.inputmethod.inputmethodmanager;import Android.widget.EditText ;//Turn on or off the soft keyboard public class keyboardutils{/** * Punch-in soft keyboard * * @param medittext input Box * @param mcontext context */public static void op Enkeybord (EditText medittext, Context mcontext) {Inputmethodmanager IMM = (Inputmethodmanager) Mcontext.getsystemservice (Context.input_method_service); Imm.showsoftinput (Medittext, InputMethodManager.RESULT_ shown); Imm.togglesoftinput (inputmethodmanager.show_forced,inputmethodmanager.hide_implicit_only);} /** * off Soft keyboard * * @param medittext input Box * @param mcontext context */public static void Closekeybord (EditText medittext, context Mcontext) {Inputmethodmanager IMM = (inputmethodmanager) mcontext.getsystemservice (Context.input_method_service); Imm.hidesoftinputfromwindow (Medittext.getwindowtoken (), 0);}}
Android Tools--------> turn the soft keyboard on or off