Created
February 22, 2013 15:15
-
-
Save korniltsev/5014112 to your computer and use it in GitHub Desktop.
Change locale in runtime
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
public void setLocale(String lang) { | |
myLocale = new Locale(lang); | |
Resources res = getResources(); | |
DisplayMetrics dm = res.getDisplayMetrics(); | |
Configuration conf = res.getConfiguration(); | |
conf.locale = myLocale; | |
res.updateConfiguration(conf, dm); | |
Intent refresh = new Intent(this, AndroidLocalize.class); | |
startActivity(refresh); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment