我keyguard manager
用来设置lock
和remove lock
喜欢这样:
protected void enabledisablekeyguard(boolean keyguard)
{
KeyguardManager keyguardManager = (KeyguardManager)getSystemService(Activity.KEYGUARD_SERVICE);
KeyguardLock lock = keyguardManager.newKeyguardLock(KEYGUARD_SERVICE);
if(keyguard)
{
lock.reenableKeyguard();
lock=null;
}
else
{
lock.disableKeyguard();
}
}
成功禁用我的键盘保护后,它不会重新启用键盘保护