5

I have a layout which contains a ListView and a EditText below the ListView which is used for searching in list view. The problem is that when i close the soft keyboard after a search, it gives a jerk and shows white space while closing the soft keyboard. I have tried adjustPan, but it moves the whole layout up.

enter image description here

  • have you test on device or emulator ? – Haresh Chhelana May 09 '14 at 12:04
  • I had a [same issue](http://stackoverflow.com/questions/20559963/empty-space-when-i-return-to-activity-soft-keyboard-forced), a white space when the soft keyboard closed. You should try to make a `Handler` with `postDelayed` method before doing something. Also did you try with `adjustResize` instead of `adjustPan`? – Blo May 09 '14 at 14:24

1 Answers1

0
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!

learner
  • 3,092
  • 2
  • 21
  • 33
Iram Bukhari
  • 487
  • 1
  • 5
  • 15