Manually set the locale of the application in Android
Android provides a flexible support of localization that system will load different resources according the locale of the current system configuration. However, sometimes we want to manually change the locale of our application especially for our Hong Kong market that people may want to have Chinese locale application in a English system configuration.
To do this, we can set the configuration of the application using the following code:
Header:
import android.content.res.Resources;
import java.util.Locale;
Resources res = getResources();
Configuration newConfig = new Configuration(res.getConfiguration());
// newConfig.locale = Locale.TRADITIONAL_CHINESE;
newConfig.locale = Locale.ENGLISH;
res.updateConfiguration(newConfig, null);

Recent comments
32 weeks 4 days ago
37 weeks 5 days ago
41 weeks 1 day ago
42 weeks 1 day ago
50 weeks 6 days ago
50 weeks 6 days ago
51 weeks 19 hours ago
51 weeks 2 days ago
1 year 6 days ago
1 year 1 week ago