I'm trying to implement an option to let the users specify if they want the app to load the theme based on the system settings (dark or light, i.e., if the device is set to use dark mode or not) but I what also to give the possibility to override the system settings.
I can easily find out how this setting is when launching the app for the first time, using something like the specified in this thread
However these seems to be useless after forcing the theme with:
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES)
After changing the theme, I can't get the system setting anymore because it will always return "darkmode on", unless I force it again to light theme, but here again it will return "darkmode off" always! :(
Any idea, how to get the system setting?
Thanks in advance,
FF