How can I detect when theme(dark or light) is changed in Android? I need to do this in background(when app is not running).
I tried BroadcastReceiver
with action Intent.ACTION_CONFIGURATION_CHANGED
but it does not work in background.
Maybe I can do this with WorkManager
with addContentUriTrigger
to Constraints
(cannot find any uri related to theme)?
Asked
Active
Viewed 192 times
2

Renattele Renattele
- 1,626
- 2
- 15
- 32