更改 Android 键盘语言

时间:2023-01-30
本文介绍了更改 Android 键盘语言的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

如何更改 Android 键盘语言?

How to change Android Keyboard language?

我设置了以下代码来设置语言.我从设置中设置了不同的语言并尝试设置英语.

I have set below code to set language. I set different language from Settings and trying to set English language.

Locale.setDefault(Locale.ENGLISH);
Configuration config = getResources().getConfiguration();
config.locale = Locale.ENGLISH;
getBaseContext().getResources().updateConfiguration(config, null);

推荐答案

更改 locale 只会将 resources(例如,字符串、图像等)更改为为应用程序中的特定 locale.要更改keyboard支持的语言,您必须确保设备上安装了正确的输入法(因为输入法本身也是一个app,所以会换成对应的语言).

Changing locale only changes the resources (e.g., strings, images, etc) to those defined for a specific locale in an app. To change the language supported by the keyboard, you have to make sure a proper input method is installed on the device (because the input method itself is also an app, it will change to a corresponding language).

例如Nexus S上只有英文键盘,如果我需要支持其他语言的键盘,我需要找到输入法 支持该语言,然后安装它.

For example, there is only English keyboard on Nexus S, if I need a keyboard that supports other language, I need to find a input method that supports that language, and install it.

为了确保用户有一个,您可以发出一些警报以引起用户的注意,或者通过 ACTION_XXX_SETTINGS 意图将他们带到键盘设置活动.

To make sure the user have one, you can make some alert to take the users' attention, or bring them to the keyboard settings activity by ACTION_XXX_SETTINGS intent.

这篇关于更改 Android 键盘语言的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

上一篇:如何在 android EditText 中强制使用英文键盘 下一篇:删除 iOS8 WebView 中自定义键盘的下一个/上一个按钮 (inputAccessoryView)

相关文章

最新文章