I\'ve the following piece of code:
/**
* Sets a new Locale for the APP.
* @param newLocale - Valid new locale.
*/
private static void setLocale( String ne
Well,
User Sir SC provided an answer which worked. But my code, also worked. The issue we were facing, was about a single device ignoring this locale change. So AFAIK, it's just a single device, and it might be caused because of a buggy ROM, as it was a Genymotion Emulator.
So overall, the answer is:
Cheers.
This is the code I am using for localisation. It is used by + 1m people and never heard of any complaint about not changing strings so I hope it will work for you as well:
On top of class:
Locale myLocale;
Function:
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);
reloadUI(); // you may not need this, in my activity ui must be refreshed immediately so it has a function like this.
}
Function Call:
//example for setting English
setLocale("en_gb");