以编程方式更改 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.....
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
无法以编程方式更改用户的键盘设置。您唯一能做的就是建议用户更改它并帮助它这样做。例如,这将显示一个对话框供他们更改键盘:
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:
据 我见过,来自一位 Android 员工这里,根本不可能以编程方式更改 IME - 它完全取决于最终用户选择他们喜欢的 IME。
As far as I've seen, and from an Android employee here, it is simply not possible to change the IME programatically - it is completely dependent on the end-user to choose their preferred IME.
就像保罗说的,你不能改变输入法;但是,您可以通过隐藏 Android 软键盘来禁用它
,然后创建一个类似于 Android 软键盘的视图。 看看这个。
Like Paul said you cannot change the IME; however, you can disable the android softkeyboard by hiding it
then create a view that resembles an android softkeyboard. Check this out.
在按钮单击上从应用程序更改键盘:
Change the keyboard from your app on Button Click :