Android IMEI Hide hideKeyboard(Context context)

Here you can find the source of hideKeyboard(Context context)

Description

hide Keyboard

Declaration

public static void hideKeyboard(Context context) 

Method Source Code

//package com.java2s;
import android.app.Activity;
import android.content.Context;

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

public class Main {
    public static void hideKeyboard(Context context) {
        InputMethodManager inputManager = (InputMethodManager) context
                .getSystemService(Context.INPUT_METHOD_SERVICE);
        View view = ((Activity) context).getCurrentFocus();
        if (view != null) {
            inputManager.hideSoftInputFromWindow(view.getWindowToken(),
                    InputMethodManager.HIDE_NOT_ALWAYS);
        }/*from   ww w  .j a  v  a  2 s .c  om*/
    }
}

Related

  1. hideSoftInput(Activity activity)
  2. hide(Context ctx, EditText edit)