Java tutorial
//package com.java2s; //License from project: LGPL import android.content.Context; import android.view.View; import android.view.inputmethod.InputMethodManager; public class Main { public static void hideKeyboard(Context context, View edt) { InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE); if (imm != null) imm.hideSoftInputFromWindow(edt.getWindowToken(), 0); } }