你好,请问如何在打开页面后自动弹出输入法呢?
Jibinghao opened this issue · comments
Jibinghao commented
默认第一行就是输入框,请问如何自动弹出输入法?
Sendtion commented
private void openSoftKeyInput(){
try {
InputMethodManager imm = (InputMethodManager)getSystemService(INPUT_METHOD_SERVICE);
if (imm != null && !imm.isActive()){
et_content.requestFocus();
//第二个参数可设置为0
imm.showSoftInputFromInputMethod(et_content.getWindowToken(),
InputMethodManager.SHOW_FORCED);
}
} catch (Exception e) {
e.printStackTrace();
}
}