I have an Android app that contains a list of products via email. I had problems when after sending the list by the mail client (it can be an exchange client or a Gmail client) the keyboard will not be closed.
I tried:
InputMethodManager mgr = (InputMethodManager) getSystemService(
Context.INPUT_METHOD_SERVICE);
mgr.hideSoftInputFromWindow(editTxt.getWindowToken(), 0);
and many other ways. If I check if the keyboard is open, it will return false, since it is not a keyboard calling application, but an email client.
I found a workaround, including:
android:windowSoftInputMode="stateAlwaysHidden"
then the application will forcefully close the keyboard, but will continue to lag every time I open the keyboard again.
With a Samsung phone, the problem exists only if I use the Gmail client.
lagos