how to programmaticaly lock screen android?
+3
A:
Check this class : com.android.internal.policy.impl.LockScreen
Referenced from here: http://stackoverflow.com/questions/3219950/can-you-lock-screen-from-your-app
Also check code for enabling and disabling lock Screen in Android. (Referenced from here)
KeyguardManager keyguardManager = (KeyguardManager)getSystemService(Activity.KEYGUARD_SERVICE);
KeyguardLock lock = keyguardManager.newKeyguardLock(KEYGUARD_SERVICE);
For locking the screen use,
lock.reenableKeyguard();
and for disabling the lock use,
lock.disableKeyguard()
YoK
2010-08-29 11:34:35
i test this code,but this not working
Mecid
2010-08-31 07:57:22
Can you share code what you tried? and What issues you are facing with it ?
YoK
2010-08-31 08:08:55
This code is not useful
Ashay
2010-10-27 11:02:09