title: Set Android screen brightness
body: <p>I am trying to set the screen brightness in android completely dark. The first time it works perfectly but after the brightness is 0 but I can see the screen. How make the android screen completely dark?</p>
  
  <p>This is my code: </p>
  
  <pre><code>WindowManager.LayoutParams params = 
  
      getWindow().getAttributes();
      params.flags |= LayoutParams.FLAG_KEEP_SCREEN_ON;
      params.screenBrightness = 0.0f;
      getWindow().setAttributes(params);
  </code></pre>