【问题标题】:How do I get my InputMethodService如何获取我的 InputMethodService
【发布时间】:2012-04-27 14:40:55
【问题描述】:

我的应用程序有 2 个部分。一个 InputMethodService 和一个 Activity。我所做的是单击 Activity 中的 Button 以查看所有可用的 InputMethod,但我在列表中看不到我的 InputMethod。

但之后我可以从设置中看到它>>>语言和键盘

这是相关代码

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

【问题讨论】:

    标签: android ime


    【解决方案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());
    }
    

    【讨论】:

      猜你喜欢
      • 2014-09-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-11-06
      • 1970-01-01
      • 2014-10-18
      相关资源
      最近更新 更多