Program into an activity directly pop-up soft keyboard, not directly in the OnCreate set, must wait until the view drawing event to pop up, need to use the Timer auxiliary implementation, if you want to implement the input function, must let EditText get focus.
//automatically open IME after app starts@Override Public voidonCreate (Bundle savedinstancestate) {Super. OnCreate (savedinstancestate); Setcontentview (R.layout.main); Timer Timer=NewTimer (); Timer.schedule (NewTimerTask () {@Override Public voidrun () {Inputmethodmanager IMM= (Inputmethodmanager) mainactivity. This. Getsystemservice (Input_method_service); Imm.togglesoftinput (0, inputmethodmanager.hide_not_always); Toast.maketext (mainactivity. This, "Show", Toast.length_short). Show (); } }, 1000);//Open in one second}
Auto Close:
Inputmethodmanager IMM = (Inputmethodmanager) Getsystemservice (context.input_method_service); 0);
Suppress pop-up:
< Activity Android:name =". Clientsearchviewactivity " android:label=" @string/app_name " android: Screenorientation= "Portrait" android:windowsoftinputmode= " Adjustunspecified|statehidden " android:configchanges=" Orientation|keyboardhidden " > </activity>
Android EditText automatically eject and automatically turn off the soft keyboard