views:

4

answers:

0

Hi.

I have an Android widget which is suppose to show news headline. My idea is this:

  • I have a widget on home screen with a news scrolling.
  • Every 30 seconds it calls it's Provider's onUpdate method which in turns invoke a service.
  • The service updates the view with next news item.

My problem is that until I have new news available; I want to cycle through last 10 news headlines. Where do I store these 10 headlines between each call to onUpdate method? And also with each call to onUpdate method how do I keep track of what was the news last displayed? Is there a simple way to do this?

Also a separate service fetches the news headline set from web every X minutes. Once I have new set available, I want to discard the older 10 items. How do I manage this updation seamlessly. I see this kind of behavior in many widgets, but am still wondering how is this done?

Any ideas will be welcome.