Call the following code: (the first call is displayed, and the second call is hidden, so repeated). This indicates activity
Inputmethodmanager Imm = (inputmethodmanager) This. getsystemservice (context. input_method_service); <br/> Imm. togglesoftinput (0, inputmethodmanager. hide_not_always); <br/> Imm. showsoftinput (myview, inputmethodmanager. show_implicit );
Hide the keyboard:
Display:
Inputmethodmanager Imm = (inputmethodmanager) This. getsystemservice (context. input_method_service); <br/> Imm. showsoftinput (myview, 0 );
Hide:
Imm. hidesoftinputfromwindow (view. getwindowtoken (), 0 );
After the program is started, a soft keyboard is automatically displayed, which can be implemented by setting a time function and cannot be written in oncreate:
Timer timer = new timer (); </P> <p> timer. schedule (New timertask () {<br/> @ override public void run () {<br/> inputmethodmanager Imm = (inputmethodmanager) This. getsystemservice (input_method_service); Imm. togglesoftinput (0, inputmethodmanager. hide_not_always); </P> <p> toast. maketext (chick. this, "show", toast. length_short ). show (); <br/>}< br/>}, 1000 );