如何获取我的InputMethodService

3
我的应用有两个部分,一个是InputMethodService,另一个是Activity。我在Activity中点击按钮以查看所有可用的输入法,但是在列表中无法看到我的输入法。
但是在此之后,我可以从“设置”>>“语言和键盘”中看到它。
以下是相关代码:
InputMethodManager inputManager = (InputMethodManager) getSystemService (Context.INPUT_METHOD_SERVICE);
                    inputManager.showInputMethodPicker();
1个回答

1

这可能会有所帮助:

InputMethodManager imeManager = (InputMethodManager) getApplicationContext().getSystemService(INPUT_METHOD_SERVICE); 
List<InputMethodInfo> lst = imeManager.getEnabledInputMethodList();
for (InputMethodInfo info : lst) {
   System.out.println(info.getId() + " " + info.loadLabel(getPackageManager()).toString());
}

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接