I set a local in my launcher activity, after a second or two the locale settings resets to the device\'s system locale settings.
After several hours of digging, I found
The issue was caused by using the deprecated updateConfiguration
on API's newer than 17, the following code solves the issue (within activity), and sets a persisting locale settings.
public void attachBaseContext(Context base) {
Resources resources = base.getResources();
Locale locale = new Locale("ru");
Locale.setDefault(locale);
Configuration config = resources.getConfiguration();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
config.setLocale(locale);
base = base.createConfigurationContext(config);
}
else {
config.locale = locale;
resources.updateConfiguration(config, resources.getDisplayMetrics());
}
super.attachBaseContext(base);
}