getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
Xml
<activity android:name="org.MainActivity" android:label="@string/app_name" android:windowSoftInputMode="stateHidden" />
或
Dialog
AlertDialog dialog = new AlertDialog.Builder(this).setView(editText).create(); dialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN); dialog.show();
沒有留言:
張貼留言