Example usage for android.view.inputmethod InputMethodManager getInputMethodList

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

Introduction

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

Prototype

public List<InputMethodInfo> getInputMethodList() 

Source Link

Usage

From source file:Main.java

/**
 * Get {@link InputMethodInfo} of the IME specified by the package name.
 * CAVEAT: This may cause a round trip IPC.
 *
 * @param packageName package name of the IME.
 * @param imm the {@link InputMethodManager}.
 * @return the {@link InputMethodInfo} of the IME specified by the <code>packageName</code>,
 * or null if not found.//from   w w  w. ja va 2  s . c  o  m
 */
public static InputMethodInfo getInputMethodInfoOf(final String packageName, final InputMethodManager imm) {
    for (final InputMethodInfo imi : imm.getInputMethodList()) {
        if (packageName.equals(imi.getPackageName())) {
            return imi;
        }
    }
    return null;
}