1

I have implemented a custom soft keyboard, which is already present in the Play Store and used by many people. In nearly all apps it works fine, but there is one anoying thing only in one app I am trying to solve.

If you use the messenger Threema and select the text field to enter letters, the keyboard is shown - but the cursor is not present! It looks like the text field is not focused. I am able to write into the text field using getCurrentInputConnection().commitText(), but I am not able to write calling getCurrentInputConnection().sendKeyEvent().

When I hit the text field a second time, it is focused, the cursor is shown and everything works fine.

Does anyone have an idea why this is the case?

1 Answers1

1

Just in case that someone faces the same problem...

I am using a method that initiates the custom keyboard view. By a mistake, it was called twice, which should not be a problem at all - but, due to any reason, the focus of the text field was lost!

I was not able to find out what causes the problem, there is no exception thrown or anything else. But if you run into the same problem, just try to execute as less commands as possible and just more and more step by step.