I'm having a weird problem with effecting the soft keyboard from working properly.
My app does not have a single EditText view in it, or using the keyboard in some way, but somehow after installing my app on several devices, working with it and then going back to use the device the soft keyboard stop working, and it's driving my crazy...
What the user sees is that when he/she clicks on a character button in the soft keyboard nothing is shown in the EditText for every app. Like I said the weird problem effects the entire system and the user can't write anything.
My app contains all kind of features, all is working with standered API, so I don't understand how can I cause this, or at least trigger it.
When the keyboard is not working and the user click on the keyboard buttons you can see in the logcat:
WARN/IInputConnectionWrapper(1628): sendKeyEvent on inactive InputConnection
WARN/IInputConnectionWrapper(1628): getCursorCapsMode on inactive InputConnection
WARN/IInputConnectionWrapper(1628): endBatchEdit on inactive InputConnection
How an InputConnection can become inactive and is there a way to activate it?
I was wondering if anyone had this kind of problem and what was the cause of that?
Looks like your Input Connection has not been closed properly. I had similar issue and fixed it in following way:
EditText editTextLogin = (EditText) findViewById(R.id.editTextLogin);
editTextLogin.requestFocus();
InputMethodManager inputManager = (InputMethodManager)context.getSystemService(INPUT_METHOD_SERVICE);
inputManager.restartInput(editTextLogin);
I had the same problem with my nexus 7 and samsung s3. I built the app with android 4.4. Usually the keyboard didn't appear for the first time or if I hide the keyboard never ever appeared again.
The problem source was android:textIsSelectable="true"
. If I removed from all the my editText
's then this error disappeared.
I had similar problem in some devices. After 2 days of changing my code I found that source of the problem is the line android:selectAllOnFocus="true"
in my EditText
1) Have you tried overriding the onPause and killing any signatures of your app with:
System.runFinalizersOnExit(true);
System.exit(1);
I'm curious if this doesn't help, can you really prove that it's your app that's causing the hangup?
2) Do you implement any sort of InputConnection on your own?
Even if not it could be your app hanging one of them up for some reason, this quote from here might have something to do with your problem as well (focus):
*Only the active client's InputConnection will accept operations. The
IMF tells each client process whether it is active, and the framework
enforces that in inactive processes calls on to the current
InputConnection will be ignored. This ensures that the current IME can
only deliver events and text edits to the UI that the user sees as
being in focus.