-1

Possible Duplicate:
Lock the android device programatically

Can any one help me how to lock a device using java Program, and here i am not using any UI means i am doing on the Service and user can not know what happening in his device. by using msm Notification i am going to locking the device without user permission. I Tried KeygardManager and DeviceAdmin but they are giving Security exceptions.

Is there any one to help. Thanks in advance.

Community
  • 1
  • 1
Jinka
  • 17
  • 5

1 Answers1

0

yes, It is possible, try this code,

KeyguardManager mgr = (KeyguardManager)getSystemService(Activity.KEYGUARD_SERVICE); 
KeyguardLock lock = mgr.newKeyguardLock(KEYGUARD_SERVICE); 
lock.reenableKeyguard();

for better understand , please visit this link.

Community
  • 1
  • 1
Lucifer
  • 29,392
  • 25
  • 90
  • 143