禁用键盘防护并在系统启动时显示活动
考虑一下:
KeyguardManager keyguardManager = (KeyguardManager)getSystemService(Activity.KEYGUARD_SERVICE);
KeyguardLock lock = keyguardManager.newKeyguardLock(KEYGUARD_SERVICE);
lock.disableKeyguard();
我已经完成了上面的代码来禁用锁屏活动的键盘保护,并且当屏幕关闭时正常触发或短信服务触发它时它会起作用。
我已将其设置为在 Android 系统启动时启动。但是,出现了键盘锁,我必须先将其解锁,然后才能看到自己的锁屏。我该如何解决这个问题?
Consider:
KeyguardManager keyguardManager = (KeyguardManager)getSystemService(Activity.KEYGUARD_SERVICE);
KeyguardLock lock = keyguardManager.newKeyguardLock(KEYGUARD_SERVICE);
lock.disableKeyguard();
I have done the above code to disable the keyguard of my lockscreen activity and it works when normal trigger or SMS service triggers it when the screen is off.
I have set it to be started onboot of the Android. However, the keyguard appears and I have to unlock it before I see my own lockscreen. How can I solve this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是有道理的,因为启动时还有一些其他进程先于所有其他应用程序运行。
但是,如果您希望将其作为第一个,请将其设置为应用程序启动器。
当然,您可能想将主页按钮意图传递给前一个启动器,当然,在预期的情况下......
It makes sense, since there are some other processes to run on boot before all other applications.
However, if you wish to have it as one of the first, set it as an app launcher.
You might want to pass home-button intents to the previous launcher, of course, when it's expected...