Java tutorial
//package com.java2s; import android.app.Activity; import android.content.Context; import android.os.IBinder; import android.view.inputmethod.InputMethodManager; public class Main { /** * This method is used to hide a keyboard after a user has * finished typing the input. */ public static void hideKeyboard(Activity activity, IBinder windowToken) { InputMethodManager mgr = (InputMethodManager) activity.getSystemService(Context.INPUT_METHOD_SERVICE); mgr.hideSoftInputFromWindow(windowToken, 0); } }