Change Input method of android device programatically android(以编程方式更改android设备的输入法)
问题描述
我正在 android 中开发一个小型应用程序,其中包括一个编辑文本和按钮.按钮仅在编辑文本不为空白后可见.因为我有 LG Optimums Android 设备,每当我点击编辑文本,因为它是 LG 设备,LG 键盘会出现,但我不想要那个键盘我想要 Android要使用的键盘.我也知道我可以进入设置=>语言&键盘&我可以改变那个键盘.但我不想使用我希望它只能通过编码来完成.
I am developing one small application in android which consist of an Edit Text & Button. Button will be visible only after edit text is not blank.Since I am having LG Optimums Android device, Whenever i click on Edit Text since it it LG device, LG Key Board will appear but i don't want that Key Board i want Android Key Board to use. I Also know that i can go into Setting=>Language & Key Board & i can change that Key Board. But i don't want to use that i want it should be done only through coding.
感谢任何帮助.....
Thanx for any Help.....
推荐答案
无法以编程方式更改用户的键盘设置.您唯一能做的就是建议用户更改它并帮助它这样做.例如,这将显示一个对话框供他们更改键盘:
It's not possible to change the keyboard settings for the user programmatically. The only thing you can do is advise the user to change it and help it to do so. For instance, this will show a dialog for them to change keyboard:
private void showInputMethodPicker() {
InputMethodManager imeManager = (InputMethodManager) getApplicationContext().getSystemService(INPUT_METHOD_SERVICE);
if (imeManager != null) {
imeManager.showInputMethodPicker();
} else {
Toast.makeText(this, R.string.not_possible_im_picker, Toast.LENGTH_LONG).show();
}
}
这篇关于以编程方式更改android设备的输入法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:以编程方式更改android设备的输入法
基础教程推荐
- iPhone - 获取给定地点/时区的当前日期和时间并将其与同一地点的另一个日期/时间进行比较的正确方法 2022-01-01
- AdMob 广告未在模拟器中显示 2022-01-01
- 通过重定向链接在 Google Play 中打开应用 2022-01-01
- iOS4 创建后台定时器 2022-01-01
- navigator.geolocation.getCurrentPosition 在 Android 浏览器上 2022-01-01
- Cocos2d iPhone 非矩形精灵触摸检测 2022-01-01
- 如何从 logcat 中删除旧数据? 2022-01-01
- libGDX 从精灵或纹理中获取像素颜色 2022-01-01
- Android:getLastKnownLocation(LocationManager.NETWORK_PROVIDER 2022-01-01
- NSString intValue 不能用于检索电话号码 2022-01-01
