Friday, February 10, 2012

How to lock the screen in an Android app i.e Disable (initial) screen lock?


KeyguardManager keyguardManager = (KeyguardManager)getSystemService(Activity.KEYGUARD_SERVICE);
KeyguardLock lock = keyguardManager.newKeyguardLock(KEYGUARD_SERVICE);
lock.disableKeyguard();

in androidmanifest:
<uses-permission android:name="android.permission.DISABLE_KEYGUARD"></uses-permission>

No comments:

Post a Comment