I have a service running in background that checks the orientation
sensor, I'd like it to stop checking when screen is locked as my
service does nothing useful then.
I've done this with a BroadcastReceiver which listens for
ACTION_SCREEN_OFF and ACTION_USER_PRESENT.

While the first works well, I noticed that ACTION_USER_PRESENT is not
triggered if the user presses a physical button during the short time
after the screens switches off but before it gets locked.
Is this a bug or is it intended to work this way?

In any case, I thought I could workaround this listening also for
ACTION_SCREEN_ON and then checking whether the screen is locked or
not, but I couldn't find a way to get this information.

What can I do?

Thank you very much,
Federico

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to