Java tutorial
//package com.java2s; import android.app.Activity; import android.view.inputmethod.InputMethodManager; public class Main { @SuppressWarnings("static-access") public static void hideSoftInput(Activity activity) { InputMethodManager imm = ((InputMethodManager) activity.getSystemService(activity.INPUT_METHOD_SERVICE)); imm.hideSoftInputFromWindow(activity.getCurrentFocus().getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS); } }