如何获取InputMethodService

时间:2012-04-16 08:59:09

标签: android ime

我的应用程序有两个部分。一个InputMethodService和一个Activity.What我点击活动中的Button来查看所有可用的InputMethods,但我看不到我的InputMethod列表。

但之后我可以在设置>>>语言和键盘

中看到它

这是相关代码

InputMethodManager inputManager = (InputMethodManager) getSystemService (Context.INPUT_METHOD_SERVICE);
                    inputManager.showInputMethodPicker();

1 个答案:

答案 0 :(得分: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());
}
相关问题