android-input-method
Android show softkeyboard with showSoftInput is not working?
When the activity launches It seems that the keyboard is initially displayed but hidden by something else, because the following works (but is actually a dirty work-around): First Method InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); editText.postDelayed(new Runnable() { @Override public void run() { editText.requestFocus(); imm.showSoftInput(editText, 0); } }, 100); Second method in onCreate to launch it … Read more
Hide Soft keyboard on return key press
If you don’t want multiple line, for you edittext you can just specify a single line. For the edittext and also you can put imeOptions as Done like this: <EditText android:id=”@+id/edittext_done” android:layout_width=”fill_parent” android:layout_height=”wrap_content” android:imeOptions=”actionDone” android:singleLine=”true” /> I clearly don’t know, whether you are trying to achieve this or not.Any way take a look. EDIT: android:singleLine … Read more
Behaviour of imeOptions, imeActionId and imeActionLabel
It’s actually up to the input method app, not the Android framework itself, to decide what to do with the values you set. The Android framework just passes the values you set through to the input method, which can then choose what buttons to show on the keyboard or an “extracted” EditText in full-screen view. … Read more
How to close the virtual keyboard from a Jetpack Compose TextField?
You can use the LocalSoftwareKeyboardController class to control the current software keyboard and then use the hide method: var text by remember { mutableStateOf(TextFieldValue(“Text”)) } val keyboardController = LocalSoftwareKeyboardController.current TextField( value = text, onValueChange = { text = it }, label = { Text(“Label”) }, keyboardOptions = KeyboardOptions(imeAction = ImeAction.Done), keyboardActions = KeyboardActions( onDone = … Read more
when using AlertDialog.Builder with EditText, the Soft Keyboard doesn’t pop
I’ve made such a thing AlertDialog.Builder b = new AlertDialog.Builder(this);//…. AlertDialog dialog = b.create(); dialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE); dialog.show();
Disabling the fullscreen editing view for soft keyboard input in landscape?
I finally answered my own question: The extract UI (i.e. the fullscreen editing mode) can be disabled at the point at which the input connection is hooked up: @Override public InputConnection onCreateInputConnection(EditorInfo outAttrs) { outAttrs.imeOptions = EditorInfo.IME_FLAG_NO_EXTRACT_UI; // etc. }