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设备的输入法


- 使用自定义动画时在 iOS9 上忽略 edgesForExtendedLayout 2022-01-01
- 在测试浓缩咖啡时,Android设备不会在屏幕上启动活动 2022-01-01
- 用 Swift 实现 UITextFieldDelegate 2022-01-01
- 如何检查发送到 Android 应用程序的 Firebase 消息的传递状态? 2022-01-01
- android 4中的android RadioButton问题 2022-01-01
- Android viewpager检测滑动超出范围 2022-01-01
- Android - 拆分 Drawable 2022-01-01
- 想使用ViewPager,无法识别android.support.*? 2022-01-01
- Android - 我如何找出用户有多少未读电子邮件? 2022-01-01
- MalformedJsonException:在第1行第1列路径中使用JsonReader.setLenient(True)接受格式错误的JSON 2022-01-01