Hi all,

I'm developing what amounts to an RSS homescreen widget that
periodically (every few hours) downloads headlines from an RSS feed,
then displays each headline in the widget one at a time, cycling to a
new item every 10 seconds.

All this functionality is working correctly, however watching some log
statements generated by the widget on the DDMS console, I see that
even when the homescreen of the device is not displayed (either
another application is in the foreground, or the display itself is
asleep), the widget content is still cycling every 10 seconds.  This
is obviously a concern for battery life.

Currently I'm using an AlarmManager to handle the cycling of the
widget content at this 10 second interval, but I have no idea how to
suspend the alarm when the homescreen is not displayed or the device
is asleep.  I have scoured the documentation, but cannot find any
obvious event I can listen for or API I can query to find out if the
homescreen is currently displayed or not.

Google's "News and Weather" widget that comes out of the box with
Froyo has similar functionality to the widget I'm developing, but it
does seem to stop cycling through news items when the homescreen is
not in the foreground or the screen is off.

Any help on how to achieve this would be greatly appreciated!

Regards,

Luke.

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