I have such code, and its work fine, but it change language only in context which was applied. I need to run this code in all activities. How can i change language in all app? I run this code in MainActivity.
Locale locale = new Locale(language);
Locale.setDefault(locale);
Resources resources = context.getResources();
Configuration configuration = resources.getConfiguration();
context.createConfigurationContext(configuration);
configuration.locale = locale;
resources.updateConfiguration(configuration, resources.getDisplayMetrics());
return true;
I took this code from answer on question: Language not changing in app Android Studio