ACTION_SCREEN_ON seems good for this, what's your problem with it? On Jul 7, 11:27 pm, Federico Pelloni <[email protected]> wrote: > 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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

