更改 Android 键盘语言 [英] Change Android KeyBoard language

查看:19
本文介绍了更改 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 键盘语言的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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