Android Keyboard Hide hiddenKeyboard(Activity activity)

Here you can find the source of hiddenKeyboard(Activity activity)

Description

hidden Keyboard

Declaration

public static void hiddenKeyboard(Activity activity) 

Method Source Code

//package com.java2s;

import android.app.Activity;

import android.view.inputmethod.InputMethodManager;

public class Main {
    public static void hiddenKeyboard(Activity activity) {
        try {/*www.j a va  2  s  . c om*/
            InputMethodManager input = (InputMethodManager) activity
                    .getSystemService(Activity.INPUT_METHOD_SERVICE);

            input.hideSoftInputFromWindow(activity.getCurrentFocus()
                    .getWindowToken(), 0);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

Related

  1. hideKeyBoard(View view, Activity activity)
  2. hideKeyboard(Context context, EditText editText)
  3. hideKeyboard(Context ctx, EditText editText)
  4. hideKeyboard(View view)
  5. hideKeyboard(EditText editText)
  6. closeSoftKeyboard(Activity activity)