可能重复: 锁定Android设备编程
任何一个可以帮助我如何锁定使用Java程序的设备,在这里我没有使用任何UI意味着我做的服务和用户不知道发生了什么在他的设备。 通过使用MSM通知我去锁定装置未经用户许可。 我试图KeygardManager和DeviceAdmin,但他们给安全例外。
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.
是的,这是可能的,试试这个code,
yes, It is possible, try this code,
KeyguardManager mgr = (KeyguardManager)getSystemService(Activity.KEYGUARD_SERVICE);
KeyguardLock lock = mgr.newKeyguardLock(KEYGUARD_SERVICE);
lock.reenableKeyguard();
有更好的理解,请访问该link.
for better understand , please visit this link.
上一篇:如何算的通知数量,在Android中显示一个图标?图标、数量、通知、Android
下一篇:添加为Silverlight 5应用程序codeD UI支持 - System.Core程序加载失败应用程序、加载、程序、codeD