Android EditText相关

获得焦点:

editTextField.requestFocus();

弹出软键盘:

InputMethodManager imm = (InputMethodManager)MainActivity.this.getSystemService(INPUT_METHOD_SERVICE); 

imm.toggleSoftInput(0, InputMethodManager.HIDE_NOT_ALWAYS);

关闭软键盘:

InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); 

imm.hideSoftInputFromWindow(editTextField.getWindowToken(), 0);




你可能感兴趣的:(android,service,input)