Android Keyboard Hide hideKeyboard(View view)

Here you can find the source of hideKeyboard(View view)

Description

hide Keyboard

License

Open Source License

Declaration

public static void hideKeyboard(View view) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import android.content.Context;

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

public class Main {
    public static void hideKeyboard(View view) {
        try {/* w ww . j a  v a2s.  co m*/
            InputMethodManager imm = (InputMethodManager) view.getContext()
                    .getSystemService(Context.INPUT_METHOD_SERVICE);
            imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
        } catch (Exception e) {
            // couldn't close keyboards
        }
    }
}

Related

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