Java tutorial
//package com.java2s; //License from project: Open Source License import android.app.Activity; import android.view.View; import android.view.inputmethod.InputMethodManager; public class Main { /** * Remove the keyboard explicitly. */ public static void hideKeyBoard(Activity mActivity, View mGetView) { try { ((InputMethodManager) mActivity.getSystemService(Activity.INPUT_METHOD_SERVICE)) .hideSoftInputFromWindow(mGetView.getRootView().getWindowToken(), 0); } catch (Exception e) { e.printStackTrace(); } } }