title: Android How to switch DarkMode(UiMode) for the whole system?
body: <p>I want to change the ui mode (eneble/disable Darkmode) for the whole android system. I have read about the <code>UiModeManager</code> and the <code>setNightMode()</code>-Method but this don't work for me. If I try to disable my DarkMode with this code:</p>
  <pre><code>UiModeManager manager = (UiModeManager) getSystemService(UI_MODE_SERVICE);
  manager.setNightMode(UiModeManager.MODE_NIGHT_NO);
  </code></pre>
  <p>nothing changed and my DarkMode is still on.</p>
  <p>And when I manually switch off the DarkMode and try to switch it on with this code:</p>
  <pre><code>UiModeManager manager= (UiModeManager) getSystemService(UI_MODE_SERVICE);
  manager.setNightMode(UiModeManager.MODE_NIGHT_YES);
  </code></pre>
  <p>it does not switch on.
  I also get no errors while debugging. Does anyone have an idea how to switch the darkmode on and off?</p>