android unlock screen intent?

前端 未结 3 1215
傲寒
傲寒 2020-12-03 15:25

Is there an intent that is fired when a user unlocks their screen? I want my app to adjust the brightness when the screen turns on, but the problem im running into is that

3条回答
  •  时光说笑
    2020-12-03 16:15

    Yes, the ACTION_USER_PRESENT is broadcasted after the user unlocks:

    http://developer.android.com/reference/android/content/Intent.html#ACTION_USER_PRESENT

    Note that this is a protected broadcast and if the user is using a lock screen replacement such as WidgetLocker or NoLock the USER_PRESENT may not be sent or may be sent at the wrong time.

    For detecting WidgetLocker's unlock see: http://teslacoilsw.com/widgetlocker/developers

提交回复
热议问题