close Soft Input - Android android.view.inputmethod

Android examples for android.view.inputmethod:InputMethodManager

Description

close Soft Input

Demo Code

import android.content.Context;
import android.view.View;
import android.view.inputmethod.InputMethodManager;

public class Main{

    public static void closeSoftInput(Context c, View focusingView) {
        InputMethodManager imm = (InputMethodManager) c
                .getSystemService(Context.INPUT_METHOD_SERVICE);
        imm.hideSoftInputFromWindow(focusingView.getWindowToken(),
                InputMethodManager.RESULT_UNCHANGED_SHOWN);
    }/*ww w. j  a v a  2 s  . c o m*/

}

Related Tutorials