Implementing screen lock in Android 2.0
<p>i am implementing the screen lock in Android 2.0 programmatically and here is my code.</p>

<pre><code>this.deviceManager = (DevicePolicyManager)getSystemService(Context.DEVICE_POLICY_SERVICE);
        deviceManager.lockNow(); 
</code></pre>

<p>but problem is i am getting this security Exception.</p>

<pre><code>03-07 12:38:33.665: ERROR/AndroidRuntime(806): FATAL EXCEPTION: main
03-07 12:38:33.665: ERROR/AndroidRuntime(806): java.lang.SecurityException: No active    admin owned by uid 10075 for policy #3
03-07 12:38:33.665: ERROR/AndroidRuntime(806):     at     android.os.Parcel.readException(Parcel.java:1247)
03-07 12:38:33.665: ERROR/AndroidRuntime(806):     at   android.os.Parcel.readException(Parcel.java:1235)
03-07 12:38:33.665: ERROR/AndroidRuntime(806):     at  android.app.admin.IDevicePolicyManager$Stub$Proxy.lockNow(IDevicePolicyManager.java:830)
03-07 12:38:33.665: ERROR/AndroidRuntime(806):     at android.app.admin.DevicePolicyManager.lockNow(DevicePolicyManager.java:569)
03-07 12:38:33.665: ERROR/AndroidRuntime(806):     at com.anquetMap.Main.onClick(Main.java:4
</code></pre>

<p>anybody can have any idea what is the problem?
any help will be appreciative.</p>

<p>thanks a lot.</p>
