问题描述
如题,有可能是我醒来我的电话和跳过屏幕锁?我想写的基础上闹钟的应用程序,当它的时候,应用程序应该做检测的东西,即使手机处于睡眠状态的背景。当检测到的东西,手机会自动唤醒,跳过屏幕锁,并显示一个画面(开始新的活动)。任何人都可以给我这些一些建议或例子?多谢!
As title, is it possible for me to wake my phone up and skip the screenlock?I want to write an app based on the alarm clock, when it's time, the app should do detect something in the background even when the phone is sleeping. When something is detected, the phone should automatically wake up, skip the screenlock, and show a picture(start a new activity ). Can anybody give me some suggestions or examples on these? Thanks a lot!
推荐答案
你开始的活动需要以下一个布局参数或两者兼而有之。
The activity you're starting needs one or both of the following layout parameters.
使用 FLAG_SHOW_WHEN_LOCKED
这样的活动出现在屏幕锁上面。
Use FLAG_SHOW_WHEN_LOCKED
so that the activity appears above the screenlock.
使用 FLAG_DISMISS_KEYGUARD
自动关闭该键盘锁。
Use FLAG_DISMISS_KEYGUARD
to automatically dismiss the keyguard.
更多细节处的.
这篇关于我如何能唤醒在Android设备和跳过屏幕锁的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!