The link of the latest app-compat
which is 1.1.0.
After upgrading my app to the latest app-compat
my language settings stopped working for phones below API 24 (roughly, doesn't work on API 21 and below for sure).
For API 24 and above, I have used the ContextWrapper
and set the locale
hence works.
My question is if the androidx.appcompat:appcompat:1.1.0
is the stable version why does it work for me in alpha
and beta
versions unlike the others here & the questions which I have tried.
- After updating AppCompat library to appcompat:1.1.0-alpha03 Locale configuration is not working anymore
- Change Locale not work after migrate to Androidx - Talks about the alpha and beta (I am using the latest stable build
1.1.0
)
Should I wait for an official stable version again and downgrade to the last stable version or which is the efficient way to let google know if any(ofcourse, I know to file a bug)?
Edit:
To continue using version 1.1.0 add this below your
attachBaseContext
:Kotlin solution:
Java solution:
Old Answer:
After spending hours trying, got to know that it might be a bug.
Downgrade to the last stable version and it works flawlessly.
Meanwhile, I have filed an issue with Google https://issuetracker.google.com/issues/140880275
There is an issue in new app compat libraries related to night mode that is causing to override the configuration on android 21 to 25. This can be fixed by applying your configuration when this public function is called:
For me, this little trick has worked by copying the settings from the overridden configuration to my configuration but you can do whatever you want. It is better to reapply your language logic to the new configuration to minimize errors
Android x has supported this type of library ...
Please always change androidx in design library or other som default android library.
And the compulsory change in layout code similar as ...
so more other some type code change in layout...