Following sage advice from CommonsWare I have elected to try to remove the long-living Service and use different techniques Actually, I believe my advice was more of a light blue... :-) But I still need to detect the screen off and on events There are certain events that Android does not want to start up new processes for, so the device does not get too slow from all sorts of stuff all having to run at once ACTION_SCREEN_ON is one of those. See this previous question for light blue advice on that topic So, you need to ask yourself, "Self, do I really need to get control on those events? ".
The core Android team would like it if your answer was "no.
Following sage advice from CommonsWare I have elected to try to remove the long-living Service and use different techniques. Actually, I believe my advice was more of a light blue... :-) But I still need to detect the screen off and on events. There are certain events that Android does not want to start up new processes for, so the device does not get too slow from all sorts of stuff all having to run at once.
ACTION_SCREEN_ON is one of those. See this previous question for light blue advice on that topic. So, you need to ask yourself, "Self, do I really need to get control on those events?".
The core Android team would like it if your answer was "no".
1 Thanks CW. It would have been marvelous if there was some kind of warning at runtime or in the documentation about ACTION_SCREEN_ON being impossible to catch. I file this one under 'gotcha'.
– Jim Blackler Apr 5 '10 at 6:06 Yeah, I think they documented that ACTION_BATTERY_CHANGED -- the quintessential example of this phenomenon -- behaves this way, but they definitely skipped this one. If you search for ACTION_SCREEN_ON in the source code (e.g. , via Google Code Search) and find its use in PowerManagerService, you'll notice the flag indicating registered-receiver-only is set. – CommonsWare Apr 5 '10 at 12:15.
I'm trying to get a BroadcastReceiver invoked when the screen is turned on. In my AndroidManifest. However it seems the receiver is never invoked (breakpoints don't fire, log statements ignored).
I've swapped out SCREEN_ON for BOOT_COMPLETED for a test, and this does get invoked. This is in a 1.6 (SDK level 4) project. A Google Code Search revealed this, I downloaded the project and synced it, converted it to work with latest tools, but it too is not able to intercept that event.
Is this perhaps no longer supported? Previously I have been able to intercept this event successfully with a call to Context. However this was performed by a long-living Service.
Following sage advice from CommonsWare I have elected to try to remove the long-living Service and use different techniques. But I still need to detect the screen off and on events.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.