本文整理匯總了Java中android.view.inputmethod.InputMethodManager.getInputMethodList方法的典型用法代碼示例。如果您正苦於以下問題:Java InputMethodManager.getInputMethodList方法的具體用法?Java InputMethodManager.getInputMethodList怎麽用?Java InputMethodManager.getInputMethodList使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.view.inputmethod.InputMethodManager
的用法示例。
在下文中一共展示了InputMethodManager.getInputMethodList方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getMyImi
import android.view.inputmethod.InputMethodManager; //導入方法依賴的package包/類
private static InputMethodInfo getMyImi(Context context, InputMethodManager imm) {
final List<InputMethodInfo> imis = imm.getInputMethodList();
for (int i = 0; i < imis.size(); ++i) {
final InputMethodInfo imi = imis.get(i);
if (imis.get(i).getPackageName().equals(context.getPackageName())) {
return imi;
}
}
return null;
}
示例2: getInputMethodAsWhiteList
import android.view.inputmethod.InputMethodManager; //導入方法依賴的package包/類
private Set<String> getInputMethodAsWhiteList(Context context) {
HashSet<String> packages = new HashSet<>();
InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
List<InputMethodInfo> methodList = imm.getInputMethodList();
for (InputMethodInfo info : methodList) {
packages.add(info.getPackageName());
}
return packages;
}
示例3: getInputMethodInfoOf
import android.view.inputmethod.InputMethodManager; //導入方法依賴的package包/類
/**
* 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.
*/
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;
}