如何更改Android键盘语言?
我已经设置低于code设置语言。 我设置不同的语言从设置中,试图把英语。
Locale.setDefault(Locale.ENGLISH);
配置配置= getResources()getConfiguration()。
config.locale = Locale.ENGLISH;
getBaseContext()getResources()updateConfiguration(配置,为空)。;
解决方案
修改区域
只改变了资源
(例如,字符串,图像等),以对那些在一个应用程序的特定区域
定义。要改变由键盘支持的语言
,你必须确保正确的输入法
安装在设备上
(因为输入方法本身也是一个应用程序,它会改变到相应的语言)。
例如,仅有的英语的键盘上的的Nexus S
,如果我需要支持其他语言的键盘,我需要找到一个输入法
支持该语言,并安装它。
要确保用户有一个,你可以做一些警觉,采取用户的注意力,或者通过 ACTION_XXX_SETTINGS
意图把他们带到键盘设置活动。
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);
解决方案
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).
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.
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.
相关推荐
最新文章