The InputMethod interface represents an input method which can generate key events and text, such as email addresses, other language characters, etc., while handling various input events, and send the text back to the application that requests text input
Questions tagged [android-input-method]
427 questions
4316
votes
128 answers
How to close/hide the Android soft keyboard programmatically?
I have an EditText and a Button in my layout.
After writing in the edit field and clicking on the Button, I want to hide the virtual keyboard when touching outside the keyboard. I assume that this is a simple piece of code, but where can I find an…

Vidar Vestnes
- 42,644
- 28
- 86
- 100
267
votes
11 answers
Disabling the fullscreen editing view for soft keyboard input in landscape?
On Android devices that use soft keyboards, I want to prevent the fullscreen keyboard editing view (shown below) from appearing when in landscape mode (i.e. I want to see only the soft keyboard itself and my view behind it).
I assume this can be…

jnic
- 8,695
- 3
- 33
- 47
125
votes
14 answers
when using AlertDialog.Builder with EditText, the Soft Keyboard doesn't pop
I am using AlertDialog.Builder in order to create an input box, with EditText as the input method.
Unfortunately, the Soft Keyboard doesn't pop, although the EditText is in focus, unless you explicitly touch it again.
Is there a way to force it to…

niros
- 1,251
- 2
- 8
- 4
105
votes
8 answers
How to close the virtual keyboard from a Jetpack Compose TextField?
I'm using the Jetpack Compose TextField and I want to close the virtual keyboard when the user press the the action button (imeActionPerformed parameter).
val text = +state { "" }
TextField(
value = text.value,
keyboardType =…

nglauber
- 18,674
- 6
- 70
- 75
49
votes
4 answers
Behaviour of imeOptions, imeActionId and imeActionLabel
I'm quite new to Android native development, and I'm trying to figure out how to customize the IME action buttons. I've looked at the Google documentation, but I can find very few information about the expected behaviour.
From the offical guide I…

Alessandro
- 620
- 1
- 5
- 8
46
votes
9 answers
Hide Soft keyboard on return key press
I've searched half a dozen other answers on SO, but haven't found one that works. All I'm trying to do is dismiss the soft keyboard when the user presses the enter button. (The equivalent of the insanely easy iOS 'resignKeyboard' call.) In the…

cph2117
- 2,651
- 1
- 28
- 41
42
votes
17 answers
Android show softkeyboard with showSoftInput is not working?
I have created a trivial application to test the following functionality. When my activity launches, it needs to be launched with the softkeyboard open.
My code does not work?!
I have tried various "state" settings in the manifest and different…

mobibob
- 8,670
- 20
- 82
- 131
33
votes
4 answers
Android - Get keyboard key press
I want to catch the press of any key of the softkeyboard. I don't want a EditView or TextView in my Activity, the event must be handled from a extended View inside my Activity.
I just tried this:
1) Override the onKeyUp(int keyCode, KeyEvent event)…

Bemipefe
- 1,397
- 4
- 17
- 30
31
votes
9 answers
android:windowSoftInputMode="adjustResize" doesn't make any difference?
I have a faux dialog which uses this layout:

Graeme
- 25,714
- 24
- 124
- 186
31
votes
6 answers
Custom EditText is not showing keyboard on focus
I am creating a custom EditText class because i need to set some custom fonts; However now when i click on the editText the android keyboard does not pop up anymore...
here is my class:
package ro.gebs.captoom.utils.fonts;
import…

Adrian Olar
- 2,883
- 4
- 35
- 63
24
votes
1 answer
How to download a file from a server and save it in specific folder in SD card in Android?
I have one requirement in my Android application. I need to download and save file in specific folder of SD card programmatically. I have developed source code, which is
String DownloadUrl = "http://myexample.com/android/";
String fileName =…

kumar Sudheer
- 705
- 3
- 8
- 28
23
votes
5 answers
Show soft keyboard even though a hardware keyboard is connected
Is there any way to show software keyboard with USB keyboard connected (in my case RFID reader)?
I tried to force show it using InputManager (with these or similar parameters), but with no luck
((InputMethodManager)…

Warlock
- 2,481
- 4
- 31
- 45
20
votes
1 answer
Android custom keyboard popup keyboard on long press
I have custom Android keyboard:
public class CustomKeyboard extends Keyboard{...}
public class CustomKeyboardView extends KeyboardView{...}
public class CustomKeyboardIME extends InputMethodService implements…

filipst
- 1,547
- 1
- 30
- 55
19
votes
1 answer
Difference between InputMethodManager SHOW_FORCED and SHOW_IMPLICIT in Android
I would like to know the behavioral difference of the constants SHOW_FORCED andSHOW_IMPLICIT. I tried both and couldn't see any difference in the first look.

Ravjit Singh
- 798
- 5
- 17
19
votes
1 answer
How to detect the Input Method Picker visibility without the Accessibility permission
I am showing the user the Input Method Picker like so and the picker pops up:
InputMethodManager im = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
im.showInputMethodPicker();
Now if the user dismisses the picker…

Aki K
- 1,222
- 1
- 27
- 49