You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We run the application when the device locale is en_US. (in this stage the application locale is en_US)
We update the configuration (locale) of the app in the application onCreate method:
Locale locale = new Locale("iw"); // hebrew for example
Locale.setDefault(locale);
android.content.res.Configuration config = new android.content.res.Configuration();
config.locale = locale;
getBaseContext().getResources().updateConfiguration(config,
getBaseContext().getResources().getDisplayMetrics());
(in this stage the application locale is iw_IL)
3. We go to the background, and after some time, when going to foreground, we discover that the application locale is reverted back to en_US.
** We didn't find the exact cause for this issue, But A quick way to reproduce this is while in background, to rotate the device to landscape and then to portrait, and then go back to our application. it happens immediately.
If you need more details, we'd love to supply.
Thanks in advance!
The text was updated successfully, but these errors were encountered:
dor506
changed the title
Locale gets reverted to default after some time in the background (target 25)
Locale gets reverted to device's default, after some time in the background (target 25)
Apr 20, 2017
Hi
We just updated our app configuration to target and compile against api 25.
The app is using multiple languages, so we set the locale in the configuration according to user selection.
We have a base activity that implements the context wrapping:
We found the following problem:
Locale locale = new Locale("iw"); // hebrew for example
Locale.setDefault(locale);
android.content.res.Configuration config = new android.content.res.Configuration();
config.locale = locale;
getBaseContext().getResources().updateConfiguration(config,
getBaseContext().getResources().getDisplayMetrics());
(in this stage the application locale is iw_IL)
3. We go to the background, and after some time, when going to foreground, we discover that the application locale is reverted back to en_US.
** We didn't find the exact cause for this issue, But A quick way to reproduce this is while in background, to rotate the device to landscape and then to portrait, and then go back to our application. it happens immediately.
If you need more details, we'd love to supply.
Thanks in advance!
The text was updated successfully, but these errors were encountered: