question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

updateLocale(); from main activity doesnt work on Android 7 and below

See original GitHub issue

Calling updateLocale() from the mainActivity which is called its baseActivity, this doesn’t seem to change the locale on Android 7 and 6.

Running this in loop shows no new locale was added or updated

`
Locale locale = this.getResources().getConfiguration().locale; //Always shows the same even after updating

String languageGW = //Language code derived from backend String phoneLocale = locale.toLanguageTag();

if(languageGW != null && !phoneLocale.equals(languageGW)){ //Change language now, discrepancy found between backend and local phone language updateLocale(Locale.forLanguageTag(languageGW));

}

`

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

6reactions
jershellcommented, Nov 21, 2019

I have this problem too. I use the solution https://stackoverflow.com/a/58004553/3751051. It’s working.

2reactions
gunhansancarcommented, Oct 1, 2019

@codeItRalf Yes, it seems there is an issue for androidx.appcompat v1.1.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why change locale doesn't work on Android ... - Stack Overflow
0' library. I use this code to change default locale of App. For Android API level >= 24 @TargetApi(Build.VERSION_CODES.N) ...
Read more >
Language and locale resolution overview - Android Developers
Starting with Android 7.0 (API level 24), Android exposes the LocaleList.getDefault() API that lets apps directly query the list of languages a ...
Read more >
Slow rendering - Android Developers
UI Rendering is the act of generating a frame from your app and displaying it on the screen. To ensure that a user's...
Read more >
Intents and Intent Filters - Android Developers
The first activity, MainActivity , is the app's main entry point—the activity that opens when the user initially launches the app with the...
Read more >
Application Fundamentals - Android Developers
Although the activities work together to form a cohesive user experience in ... Android apps don't have a single entry point (there's no...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found