Android app does not update after hiding hidden keyboard

After entering text using the special Android keyboard and closing it manually using the key available under the keyboard, the application page does not refresh. Black space appears where the keyboard was.

I tried to use various options available for windowSoftInputMode, and this does not fix this problem. Unfortunately, adjustPan does not show the expected behavior. The keyboard hides text fields when the windowSoftInputMode parameter is set to Pan.

How can I refresh the page after the soft keyboard is hidden to fix this problem?

+4
source share
2 answers

Depending on your circumstances, adding

android:windowSoftInputMode="adjustPan"

or

android:windowSoftInputMode="adjustNothing"

An activity tag in the manifest may solve the problem.

Both worked in my case.

+6
source

Try this in the manifest

android:windowSoftInputMode="stateHidden" 
            android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"

Try also this code,

android:configChanges="keyboardHidden"

Or try this,

InputMethodManager imm = (InputMethodManager)getSystemService(
      Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(myEditText.getWindowToken(), 0);
+1
source

All Articles