Screen lock in android
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/4545079/lock-the-android-device-programatically">Lock the android device programatically</a>  </p>
</blockquote>



<p>Does the application have the ability to lock the screen?I have tried the following code.but nothing happens.</p>

<pre><code> KeyguardManager keyguardManager = (KeyguardManager)getSystemService(Activity.KEYGUARD_SERVICE);
            KeyguardLock lock = keyguardManager.newKeyguardLock(KEYGUARD_SERVICE);
            lock.reenableKeyguard();
</code></pre>

<p>Thanks.</p>
