An InputConnection is used in Android for an input method editor (IME) to communicate text changes to an editor (like EditText).
Questions tagged [inputconnection]
34 questions
13
votes
5 answers
Flutter: getTextBeforeCursor on inactive InputConnection
I'm trying to retrieve the user input inside a TextField title so it can be passed to a function called void _filterList(value).
However, everytime I put some text this errors appear:
W/IInputConnectionWrapper( 7715): getTextBeforeCursor on…

loma
- 153
- 1
- 1
- 6
8
votes
2 answers
How to implement Extracted Text for a custom Android View
Background
A custom editor view in Android is able to receive text from a system keyboard though an InputConnection. I have been able to make such a view successfully. However, when the device is in landscape mode, the system will sometimes choose…

Suragch
- 484,302
- 314
- 1,365
- 1,393
5
votes
1 answer
Setting the cursor at the start of inserted text with InputConnection.commitText
The documentation for InputConnection.commitText(CharSequence text, int newCursorPosition) says that newCursorPosition means:
int: The new cursor position around the text, in Java characters. If >
0, this is relative to the end of the text - 1;…

Suragch
- 484,302
- 314
- 1,365
- 1,393
5
votes
3 answers
Android: InputConnection is missing a getSelection() method
Why do I have a setSelection in InputConnection, but not a getSelection()?
Should I just do a getTextBeforeCursor(VERY_HIGH_NUMBER, 0) and calculate the .length() of that string?

znq
- 44,613
- 41
- 116
- 144
5
votes
2 answers
input connection-how to delete selected text?
I made a custom keyboard for android. When I press backspace button of my keyboard I use
getCurrentInputConnection().deleteSurroundingText(1, 0);
to delete one letter from the input field. But when I select some text and then press the backspace…

isht
- 65
- 2
- 11
4
votes
1 answer
Flutter error: W/IInputConnectionWrapper: getExtractedText on inactive InputConnection
I have a Flutter error:
W/IInputConnectionWrapper: getExtractedText on inactive InputConnection
It occurs when I clear the text in the TextField from TextEditingController input.
This is my clear text function, it works:
_onClear() {
setState(() {
…

Mark
- 83
- 1
- 8
4
votes
0 answers
How to detect and remove a unicode-sequence emoji symbol from inputConnection?
Let's say I have an edittext field and I have to implement "backspace" functionality on it.
Deleting a simple letter character is fine, it works:
Character.isLetter(inputConnection.getTextBeforeCursor(1, 0).toString()) {
…

Starwave
- 2,352
- 2
- 23
- 30
3
votes
0 answers
Keyboard issues while using BaseInputConnection inside the Custom Webview Android
I have overridden the onCreateInputConnection inside the Custom WebView class like below
class CustomWebView extends WebView {
public CustomWebView(@Nullable Context context) {
super(context);
…

Raghul Vaikundam
- 588
- 4
- 20
2
votes
1 answer
Calling methods of InputMethodService from Jetpack Compose
Trying to make a custom Keyboard using Jetpack Compose. Cannot figure out how call currentInputConnection or other methods from Composable.
@Composable
fun CustomKeyboard() {
var inputVal by remember { mutableStateOf("") }
Column(
…

Swpan Datta
- 23
- 4
2
votes
1 answer
InputConnection comitting text deletes the default keyboards input text
Hello everyone I am trying to make an in app keyboard and it is working except for if the default keyboard inputs something and then my keyboard enters something, the default keyboards input is erased before my keyboard input is put in.
class…

JRowan
- 6,824
- 8
- 40
- 59
2
votes
2 answers
How to find the position of Cursor to select text from that position in Edit text?
I am working on Keyboard for android devices where i am Text editing options like Google Keyboard like (Text selection, copy paste etc).
for example i typed a text ABSCEONDER and now i want to selection some portion of text. like i want text…

S.J Hashmi
- 73
- 9
2
votes
1 answer
EditText: NPE in InputConnection.reportFullscreenMode
Note: the problem I'm trying to work around is restricted to Rockchip RK312X based no-name China tablets running SDK 23 (Marshmallow). No other devices seem to be affected, but unfortunately I'm forced to use those crappy devices (which also have…

Droidman
- 11,485
- 17
- 93
- 141
2
votes
1 answer
Set composing text on an EditText from a custom keyboard in Android
Explanation of what I am trying to do
I'm making a custom in-app keyboard that works on the same principle of this example. However, in my keyboard I'm using popup windows to display extra letter forms. In traditional Mongolian letters have…

Suragch
- 484,302
- 314
- 1,365
- 1,393
2
votes
2 answers
How to make delete key- delete all selected edit text in custom android keyboard
I am creating custom android keyboard and I want delete key to delete all the edit text if they are selected.
i.e, when text is selected, clipboard(cut,copy,paste comes up); in that mode , if the delete key is pressed, it should delete all. It…

Bhavita Lalwani
- 903
- 1
- 9
- 19
1
vote
0 answers
InputConnection.getTextBeforeCursor() takes too long time and ANR occurred
I'm releasing 3rd party keyboard application on the Google Play Store.
I received some ANRs like below
Input dispatching timed out (e716b5 InputMethod (server) is not responding. Waited 10001ms for MotionEvent)
at sun.misc.Unsafe.park (Native…

Heegyu Kim
- 11
- 3