How to get checkbox preference value?
<p>I have checkbox in preferences. I want to keep screen on if checkbox is checked and not to keep screen on if checkbox is not checked.</p>

<p>I want something like this:</p>

<pre><code>boolean keepScreen = sharedPrefs.getBoolean("chck_screen", false);

if (keepScreen.equals(false)) {
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

}
</code></pre>

<p>Please, help.</p>
