hide Keyboard - Android android.view.inputmethod

Android examples for android.view.inputmethod:InputMethodManager

Description

hide Keyboard

Demo Code

import android.content.Context;
import android.view.View;
import android.view.inputmethod.InputMethodManager;

public class Main {

  public static void hideKeyboard(Context c, View v) {
    InputMethodManager mgr = (InputMethodManager) c.getSystemService(Context.INPUT_METHOD_SERVICE);
    mgr.hideSoftInputFromInputMethod(v.getWindowToken(), 0);
  }//from  www  .  ja v a 2 s.c o  m

}

Related Tutorials