Launch android app on screen unlock

后端 未结 2 1675
无人共我
无人共我 2021-01-01 05:49

I want to build a lock screen replacement application. Is there any way to create a listener/service that would launch my app whenever the user wakes up/unlocks the screen?

2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-01 06:20

    I believe you are looking for the ACTION_USER_PRESENT intent action.

    public static final String ACTION_USER_PRESENT

    Since: API Level 3 Broadcast Action: Sent when the user is present after device wakes up (e.g when the keyguard is gone).

    That said, Android does not support replacing the lock screen at this time. Any apps on the market that claim to do this make use of security loop holes and are not secure. You can read this thread for more information. (in particular, you should read Mark Murphy's posts). Sorry.

提交回复
热议问题