title: Turn ON Screen programmatically on Android
body: <p>I need to programmatically turn the screen on when the user turns off with power button, and yes I always have the correct flags in the <code>Activity</code> to keep screen on, but it does not avoid user pressing power button.</p>
  
  <p>So far I've found a solution but it uses a <strong>deprecated wakelock</strong></p>
  
  <pre><code>sWakeLock = sPM.newWakeLock(PowerManager.FULL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP | PowerManager.ON_AFTER_RELEASE, TAG_WAKELOCK);
  
  sWakeLock.acquire();
  sWakeLock.release();
  </code></pre>
  
  <p>There is a better way to achieve it?</p>