Last active
August 29, 2015 14:08
-
-
Save jimbray/a2c57cb094ad65f4a49a to your computer and use it in GitHub Desktop.
在应用中切换语言
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Resources resources = getResources();//获得res资源对象 | |
Configuration config = resources.getConfiguration();//获得设置对象 | |
DisplayMetrics dm = resources .getDisplayMetrics();//获得屏幕参数:主要是分辨率,像素等。 | |
config.locale = Locale.SIMPLIFIED_CHINESE; //简体中文 | |
resources.updateConfiguration(config, dm); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment