使用
android:windowSoftInputMode="stateAlwaysVisible"
输入到
AndroidManifest.xml
文件
这样地:
<activity android:name=".YourActivity"
android:label="@string/app_name"
android:windowSoftInputMode="stateAlwaysVisible" /> // OR stateVisible
如果该活动
EditText
所以活动何时开始
键盘自动打开
如果你想继续营业
Keyboad
使用完成任何操作后,请通过
程序上
InputMethodManager imm =
(InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
imm.toggleSoftInputFromWindow(
linearLayout.getApplicationWindowToken(),
InputMethodManager.SHOW_FORCED, 0);
或
显示软键盘
InputMethodManager imm = (InputMethodManager)
getSystemService(Context.INPUT_METHOD_SERVICE);
imm.showSoftInput(EDITABLE_VIEW,
InputMethodManager.SHOW_IMPLICIT);
或
EDITABLE_VIEW
可以是任何聚焦在屏幕上的视图
mEditText = (EditText) findViewById(R.id.editText);
InputMethodManager imm = (InputMethodManager)
getSystemService(Context.INPUT_METHOD_SERVICE);
imm.showSoftInput(mEditText ,
InputMethodManager.SHOW_IMPLICIT);
或
((InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE)).showSoftInputFromInputMethod(editText.getWindowToken(), 0);
Documentation