以编程方式切换键盘配置文件 [英] Switch keyboard profile programmatically

查看:88
本文介绍了以编程方式切换键盘配置文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么方法可以通过编程方式切换已安装的键盘(而无需手动进入设置部分)?

Is there any way that we can switch installed keyboards programmatically (without going to the settings section manually)?

我的要求是向用户展示安装在手机上的所有键盘,并获得一个选择对话框以切换到一个愿望?

My requirement is that the user is presented with all the keyboards which are installed on the phone and gets a chooser dialog to switch to the one wishes?

(基本上,我们希望减少将他转移到设置页面的步骤)

(basically we want to cut down the step to transfer him to the settings page)

推荐答案

这段代码将满足您的要求:

This piece of code will fulfill your requirements:

InputMethodManager imeManager = (InputMethodManager) getApplicationContext().getSystemService(INPUT_METHOD_SERVICE);
imeManager.showInputMethodPicker();

正如Commonsware在他的回答中指出的那样,没有办法在用户的背后做这件事.

As Commonsware points out in his answer, there is no way to do this behind the user's back.

这篇关于以编程方式切换键盘配置文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆