Closed dor506 closed 5 years ago
have you found a solution yet ?
any update on it?
You have to wrap both ContextWrapper
@Override
protected void attachBaseContext(Context newBase) {
ContextWrapper localeContextWrapper = LocaleContextWrapper.wrap(newBase, new Locale("en", "US"));
ContextWrapper calligraphyContextWrapper = CalligraphyContextWrapper.wrap(localeContextWrapper);
super.attachBaseContext(calligraphyContextWrapper);
}
Thanks @SudaNix
Hi
In android 25 and above, updateConfiguration is deprecated https://developer.android.com/reference/android/content/res/Resources.html#updateConfiguration(android.content.res.Configuration,%20android.util.DisplayMetrics)
Until now I used this function to apply language for the application ("iw" language). But it is no longer working in android 26
There's a nice fix for that: https://stackoverflow.com/questions/39705739/android-n-change-language-programatically/40849142#40849142
The problems is that it does the same thing as you do in BaseActivity's attachBaseContext method.
How to combine both of them then?
Thanks In Advance!