close Soft Input - Android User Interface

Android examples for User Interface:Input Method

Description

close Soft Input

Demo Code


//package com.java2s;

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);
    }//from w w  w  . j  a va 2 s. co m
}

Related Tutorials