Lock phone using a android application -


possible duplicate:
lock android device programatically

i trying lock phone using application,

i have tried following code, no use,i inserted user permissions too.

keyguardmanager manager = (keyguardmanager) getsystemservice(context.keyguard_service); keyguardlock lock = manager.newkeyguardlock("hh"); lock.disablekeyguard(); lock.reenablekeyguard(); 

please suggest me code lock phone.

add permission in androidmanifest.xml file

<uses-permission android:name="android.permission.disable_keyguard"/>  

and

keyguardmanager mgr = (keyguardmanager)getsystemservice(activity.keyguard_service);  keyguardlock lock = mgr.newkeyguardlock(keyguard_service);  lock.reenablekeyguard(); 

Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -