Alexey Volovoy wrote:
> hm.. based on the  logs from UpdateService onStart - it's still
> executing update after i've uchecked the setting.

That's odd. That means they must be using a WAKEUP form of AlarmManager.
I would have expected otherwise.

One option is for you to watch for ACTION_SCREEN_ON and
ACTION_SCREEN_OFF broadcast Intents in your service (or use some other
method to see if the screen is not -- not sure if there's a simple API
for that). When you know the screen is off, skip the work in the update.

Another alternative is for you to specify an effectively infinitely long
updateTimeMillis (2 billion milliseconds or so is over a year) and use
AlarmManager yourself. You can push updates to the widget whenever you
want -- updateTimeMillis is just a convenient means for doing so. In
your own AlarmManager work, don't use one of the WAKEUP variants, and
the alarm will fire when the phone next awakens if it ordinarily would
have fired while the phone was asleep.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Warescription: Three Android Books, Plus Updates, $35/Year

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to