Example usage for android.view.inputmethod InputMethodManager isActive

List of usage examples for android.view.inputmethod InputMethodManager isActive

Introduction

In this page you can find the example usage for android.view.inputmethod InputMethodManager isActive.

Prototype

public boolean isActive() 

Source Link

Document

Return true if any view is currently active in the input method.

Usage

From source file:org.zywx.wbpalmstar.engine.EBrowserView.java

private void hideSoftKeyboard() {
    try {// w w w .ja v  a2 s  .  c o m
        InputMethodManager imm = (InputMethodManager) getContext()
                .getSystemService(Context.INPUT_METHOD_SERVICE);
        if (imm.isActive()) {
            imm.hideSoftInputFromWindow(this.getWindowToken(), 0);
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}

From source file:com.tct.mail.browse.ConversationItemView.java

/**
 * hide the system's soft keyboard if it is active
 *//*from www  . j  av a 2s  . c  om*/
private void hideSoftKeyboard() {
    if (mContext == null) {
        return;
    }
    InputMethodManager imm = (InputMethodManager) mContext.getSystemService(Context.INPUT_METHOD_SERVICE);
    if (imm != null) {
        if (imm.isActive()) {
            imm.hideSoftInputFromWindow(this.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
        }
    }
}

From source file:org.zywx.wbpalmstar.engine.universalex.EUExWindow.java

private void hideSoftKeyboard(IBinder wToken) {
    try {//from  w  w w .j  a  v a  2s . com
        InputMethodManager imm = (InputMethodManager) mContext.getSystemService(Context.INPUT_METHOD_SERVICE);
        if (imm.isActive()) {
            imm.hideSoftInputFromWindow(wToken, 0);
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}