Java tutorial
//package com.java2s; //License from project: Open Source License import android.content.Context; import android.os.IBinder; import android.view.inputmethod.InputMethodManager; public class Main { /** * Hides the soft keyboard. * * @param context Application context * @param windowToken Window token */ public static void hideSoftKeyboard(final Context context, final IBinder windowToken) { InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(windowToken, 0); } }