Here you can find the source of hide(Context ctx, EditText edit)
public static void hide(Context ctx, EditText edit)
//package com.java2s; import android.content.Context; import android.view.inputmethod.InputMethodManager; import android.widget.EditText; public class Main { public static void hide(Context ctx, EditText edit) { ((InputMethodManager) ctx//from w ww . j a v a 2 s. c o m .getSystemService(Context.INPUT_METHOD_SERVICE)) .hideSoftInputFromWindow(edit.getWindowToken(), 0); } }