Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android soft keyboard not working

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?

like image 399
goldmank Avatar asked Sep 01 '11 06:09

goldmank


1 Answers

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);
like image 56
mastak Avatar answered Oct 03 '22 12:10

mastak