I have been struggling with the sample android application provided by Google for integrating some Google calendar functionality found here at Google code.
I've modified the original code just a tad. Specifically, in the CalendarAndroidSample.java class at line 326 I've modified:
CalendarUrl url = CalendarUrl.forAllCalendarsFeed();
to now compute:
CalendarUrl url = CalendarUrl.forEventFeed(settings.getString("accountName", "NULL"), "private", "full");
This fills the listview with all of the events in my calendar just fine.
The infinite loop occurs whenever I add an event to my google calendar. Once a new event is added, the sample app freezes up, and looking at the DDMS I can see the logcat spitting out this repeatedly without an end:
06-19 11:19:28.556: DEBUG/dalvikvm(7493): GC_FOR_MALLOC freed 11761 objects / 519744 bytes in 39ms
The only way that I've found to stop the app from looping is to delete the calendar event. Once the calendar event is deleted, the app comes back to life and lists my events, BUT, the listview now contains all of my events, repeated over and over again. It's like the feed never stops.
My best guess is that at line 333, where the code reads:
String nextLink = feed.getNextLink();
if (nextLink == null) {
break;
nextLink never becomes null, thus creating the loop. But why does this happen ONLY when I add a calendar event?
EDIT:
I deleted some calendar events and it started working. It seems as though if the calendar has more than 25 events, it starts to loop? What is the meaning of this?!