3

I am using the following code to hide the soft keyboard from screen

InputMethodManager inputMethodManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
        inputMethodManager.hideSoftInputFromWindow(
                mSearchView.getWindowToken(), 0);

When the keyboard closes a white box appears in the space that had been covered it for a small period of time, can this be avoided?

pvn
  • 2,016
  • 19
  • 33

2 Answers2

0

Try the following :

        InputMethodManager inputMethodManager = (InputMethodManager)  activity.getSystemService(Activity.INPUT_METHOD_SERVICE);
        inputMethodManager.hideSoftInputFromWindow(activity.getCurrentFocus().getWindowToken(), 0);
kAnNaN
  • 3,669
  • 4
  • 28
  • 39
  • 1
    This doesn't solve the issue, a white box still appears when the soft keyboard is closed – pvn Apr 02 '14 at 12:30
0

The problem was that I had set windowSoftInputMode property to adjustResize for the activity in manifest.

pvn
  • 2,016
  • 19
  • 33