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
16
votes
3 answers
How to determine the current IME in Android?
I have an application where I would like to warn the user if they are not using the default Android softkeyboard. (i.e. they are using Swype or some thing else).
How can I check which input method they currently have selected?

jkhouw1
- 7,320
- 3
- 32
- 24
15
votes
9 answers
Get input text with customview without edittext android
I have created customview. Whenever user double taps on the view it should display the keyboard and user can draw new Text.
Holder is a customview which extends view. But it's showing the keyboard. How to get the text?
public Holder(Context…

Asthme
- 5,163
- 6
- 47
- 65
15
votes
4 answers
How can I use a custom font in the input area of an input method?
We're developing an app where we need to use a custom font (a Typeface loaded from the app's assets) in an EditText. The Android input method docs state the following:
When input focus moves into or out of an editable text field, Android shows or…

Ted Hopp
- 232,168
- 48
- 399
- 521
15
votes
2 answers
Android: Backspace in WebView/BaseInputConnection
I have a problem with soft keyboard backspace in Android (4.2).
I have a custom editor in a WebView (CodeMirror), which uses an empty

Andrey Shchekin
- 21,101
- 19
- 94
- 162
14
votes
1 answer
Android: Determine active input method from code
How do you determine which input method is currently active - A user can change the input method (soft keyboard) by long pressing on a text edit field - From code, how does one determine which input method the user has chosen

kate bruce
- 141
- 1
- 1
- 4
14
votes
2 answers
Get specific drawable from state list drawable
I have a state list drawable, and i want to get a specific drawable from the state list drawable:

Tazz
- 781
- 1
- 8
- 23
13
votes
2 answers
Better way to get all the text in an EditText from an InputConnection?
I've written an IME (InputMethodService) and I need to get all the text from the EditText it is editing. I know one way:
InputConnection inputConnection = getCurrentInputConnection();
inputConnection.append(inputConnection.getTextBeforeCursor(9999,…

Barry Fruitman
- 12,316
- 13
- 72
- 135
13
votes
3 answers
InputMethodService with Jetpack Compose - ComposeView causes: Composed into the View which doesn't propagate ViewTreeLifecycleOwner
You can find a sample project to reproduce the issue on Github
I've been trying to use Jetpack Compose for a Keyboard UI. Ultimately, When I try to inflate the Keyboard via the InputMethodService
class IMEService : InputMethodService() {
…

Yannick
- 4,833
- 8
- 38
- 63
13
votes
3 answers
How can I tell if the input method picker is open or closed?
My app opens the input method picker (the menu where you choose a keyboard) with InputMethodManager.showInputMethodPicker(). My app doesn't actually create the picker (it's created by InputMethodManager) but I know it's a ContextMenu and its id is…

Barry Fruitman
- 12,316
- 13
- 72
- 135
12
votes
2 answers
How to show soft keyboard perfectly in fragment in Android?
I have an EditText inside a Fragment inside a Activity.
My Activity layout:

Waylent
- 175
- 1
- 1
- 11
12
votes
2 answers
Android: how to capture long press event on soft input/keyboard?
Short version of question: how can I capture long press event on soft input/keyboard in Android?
Long version:
In an Android app, we have a multi-line EditText, and we want to have this behavior:
1. By default, it's showing a DONE button, by tapping…

Samuel Cai
- 213
- 2
- 9
10
votes
0 answers
References to getCurrentActivity make it impossible to build an InputMethodService on Android
https://github.com/facebook/react-native/issues/7762
I'm trying to build a custom keyboard with React-Native on Android. They are implemented with a InputMethodService and thus it is really hard to provide an rnplay for. I've tracked things down to…

Austin Fatheree
- 842
- 1
- 7
- 18
10
votes
4 answers
display built-in emoji keys for inputmethod
I'm building a custom soft keyboard for android and would like to add a layout to include the emoji keys similar to what the default android keyboard (AOSP) is doing. I've searched around but it seems that most people are trying to display custom…

user1715925
- 607
- 9
- 26
10
votes
3 answers
Why android InputMethodManager.showSoftInput() returns false?
Recently while developing an app, I faced an issue. I have searched a lot on google but couldn't find any solution. In the end I came across this Android issue tracker
To explain my issue, I have made a sample App.
Basic Working of my Sample App
I…

Vipin Sharma
- 141
- 1
- 6
10
votes
7 answers
Need number only soft keyboard?
Hi I need a soft keyboard with only numeric values 0 to 9 and Enter key. Shouldn't show anything other than these like . , ( ) etc...
I tried several options as suggested here but nothings seems to work for…

Akh
- 5,961
- 14
- 53
- 82