Changing The Locale Is Modifying The Text Dimensions Of My App
I'm trying to change the language on my Android app and I'm using this code: String languageToLoad = 'en'; Locale locale = new Locale(languageToLoad); Locale.setDefault(locale);
Solution 1:
After a few hours of searching, I found the solution in a comment here: Android changing language configuration messes up layout
Basically you have to replace
Configurationconfig=newConfiguration();
with
Configurationconfig= getBaseContext().getResources().getConfiguration();
This way, you don't create a new configuration, but only modifying the existing one.
Post a Comment for "Changing The Locale Is Modifying The Text Dimensions Of My App"