Android Lock Phone Programatically Not Working
<p>in my activity I call this method when I click a button:</p>

<pre><code>private void LockPhone()
    {
        KeyguardManager keyguardManager = (KeyguardManager)getSystemService(Activity.KEYGUARD_SERVICE);
        KeyguardLock lock = keyguardManager.newKeyguardLock(KEYGUARD_SERVICE);
        lock.disableKeyguard();
        lock.reenableKeyguard();
    }
</code></pre>

<p>However absolutely nothing happens, I know the button works fine because other code gets executed (temporary test code I put in there to set text on a TextView).</p>

<p>I have the following permission in my manifest:</p>

<pre><code>&lt;uses-permission android:name="android.permission.DISABLE_KEYGUARD"&gt;&lt;/uses-permission&gt;
</code></pre>
