Home > Enterprise >  How to force day mode only?
How to force day mode only?

Time:05-28

My App should support only day mode, If the night mode (dark mode?) from Android is active my App should ignore it and should be shown in day mode.

AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO); did not work on my Oreo

CodePudding user response:

In android studio, in the project panel, go to app > res > values > themes > themes.xml(night). There you can change the values. You can force any colour you want. And if you want that only day theme should prevail then copy whatever code (inside style excluding style statement) is there in themes.xml (day) and paste it in themes.xml (night). This way, night mode shall work but just like day mode without making any difference.

CodePudding user response:

Thank you. That I must fill out the themes.xml for night too I did not know. I can not say what was the solution at least: I make a mistake by my self: And install the App on the phone but did not read "...was not installed" and so tested always with the old version. :-|

  • Related