This repository was archived by the owner on Jul 11, 2025. It is now read-only.

Description
Steps to reproduce:
Without layoutDirection|locale|screenLayout added to android:configChanges
- Testing in API 35
- Works as expected: UI stringResource strings did change when switching language
- Unexpected: screen flashes (completely black screen before showing changed UI string)
- Testing in API 31 & API 24
- Works as expected: UI stringResource strings did change when switching language
- Works as expected: screen won't flash
With layoutDirection|locale|screenLayout added to android:configChanges
To fix the screen flash problem during language switching, I tried to add layoutDirection|locale to android:configChanges to <activity>
- Testing in API 35
- Works as expected: UI stringResource (string changed when switching language)
- Works as expected: screen won't flash again
- Testing in API 31 & API 24
- Unexpected: UI stringResource strings didn't change when switching language (only the current language label of the language dropdown changed)
- Testing in another application with AnimatedVisibility used: the string only changed to the switched language when they change their visibility
- Works as expected: screen won't flash
Additional information
There are several articles mentioned attachBaseContext and onConfigurationChanged, but I couldn't find any up-to-date solution.