Is PollService being used?


#1

Hi, I was worked through the example a week or so back and started working on a similar task.

In looking at the code now I see in onHandleIntent the arraylist of galleryitems getting created. What I can’t figure out is how is this array list send back to the Fragment.

In looking at the code for the Fragment it is still calling the asynctask rather than the PollService, is this wrong or what am I missing?

Your assistance appreciated.


#2

You are correct - PhotoGalleryFragment does not use PollService to fetch GalleryItems at all. PhotoGalleryFragment turns the alarm that starts PollService on and off, but otherwise they are independent components.

PollService is only used to poll the web service to see if there are any new results. It checks its own results against the last results it found, and posts a notification if it finds a new result.