hide Input Panel - Android android.view.inputmethod

Android examples for android.view.inputmethod:InputMethodManager

Description

hide Input Panel

Demo Code

import android.app.Activity;
import android.view.inputmethod.InputMethodManager;

public class Main {

  public static void hideInputPanel(Activity activity) {
    InputMethodManager imm = (InputMethodManager) activity.getSystemService(Activity.INPUT_METHOD_SERVICE);
    if (imm.isActive()) {
      imm.hideSoftInputFromWindow(activity.getCurrentFocus().getApplicationWindowToken(),
          InputMethodManager.HIDE_NOT_ALWAYS);
    }//from  w  w  w.j  a  va2 s .c  o  m
  }

}

Related Tutorials