I've dug through the documentation but couldn't find a call that would
fit: Is there a way to find out the screen status (Active/dark)?
Thanks in advance!
P.S.
Here's the situation: I've got an app that implements the relevant
data processing and backend server connectivity through a Service that
I keep running on a reduced activity level when the user puts the
device to sleep (using end button), or when the screen timeout hits.
In the app code, I can follow this status change, because it triggers
calls to overloaded onStop() and onPause() methods of the app's
subclassed Activity. This way, I control active/reduced ("sleep")
activity levels of that Service. Everything's cool and dandy in this
scenario.
Enter an AppWidget that's using this Service in a similar fashion,
with functionality implemented in a subclass of AppWidgetProvider.
This changes the game - I have found no way to determine when to set
the Service to the reduced ("sleep") activity level from that point.
The app's Activity has long paused, and I keep the Service at active
level, as the widget needs updates from the Service similar to what
the Activity needs when in front. With the AppWidget on the home
screen, I want, and should (re: battery life), drop the Service's
activity level when the device enters sleep mode. The most elegant way
to handle this would be to detect whether the screen is dark, right
inside the Service. Any way to do this?
JP
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---