How to programmatically check the screen on/off proactively?
<p>I found the following code can do this in a passive way.</p>

<pre><code>context.registerReceiver(this.ScreenOffReceiver, new IntentFilter(Intent.ACTION_SCREEN_OFF));
</code></pre>

<p>But how to get this in a proactive way? That is, at any time, the code can check the current screen is on or off.</p>
