我想锁定手机,当我点击锁button.anybody请帮忙用简单的codeI试图与来自API_Demos code的一部分,但它显示了一些错误。
i want to lock the phone when i click the lock button.anybody please help with simple code.i tried with part of code from API_Demos but it shows some error.
在code:
KeyguardManager mgr = (KeyguardManager)getSystemService(Activity.KEYGUARD_SERVICE);
KeyguardLock lock = mgr.newKeyguardLock(KEYGUARD_SERVICE);
lock.reenableKeyguard();
将不会锁定屏幕。它只是使键盘保护锁。当您运行与
will NOT lock the screen. It just enables the keyguard lock. When you run with
lock.disableKeyguard();
和preSS锁定按钮,在设备上也不会锁定键盘锁。 要锁定屏幕编程,你必须参阅设备管理并使用locknow()方法来锁定设备。
and press lock button on the device it will not lock the keyguard. To lock the screen programatically you have to refer to Device Admin and use locknow() method to lock the device.
上一篇:C++ 中的堆栈损坏堆栈