Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
502 views
in Technique[技术] by (71.8m points)

android unlock screen intent?

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 the screen on intent is fired on the lock screen and it does not adjust the display on that screen.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...