Android: displaying WhiteSpace when closing a soft keyboard

I have a layout that contains a ListView and an EditText under the ListView, which is used to search as a list. The problem is that when I close the soft keyboard after searching, it gives a jerk and shows a space when closing the soft keyboard. I tried adjustPan, but it moves the whole layout.

enter image description here

+4
source share
1 answer
public static void hideKeyboard(Context context,View v)
    {
        InputMethodManager imm = (InputMethodManager)context.getSystemService(
                  Context.INPUT_METHOD_SERVICE);
            imm.hideSoftInputFromWindow(v.getWindowToken(), 0);

    }

Hope this helps!

0
source

Source: https://habr.com/ru/post/1539909/


All Articles