I struggled with a sample android application provided by Google to integrate some of the Google calendar features found here in Google code.
I changed the original code a little bit. Specifically, in the CalendarAndroidSample.java class on line 326, I changed:
CalendarUrl url = CalendarUrl.forAllCalendarsFeed();
to calculate:
CalendarUrl url = CalendarUrl.forEventFeed(settings.getString("accountName", "NULL"), "private", "full");
This fills the list with all the events on my calendar.
An infinite loop occurs whenever I add an event to my Google calendar. After adding a new event, the sample application freezes, and looking at DDMS, I see logcat splashing it repeatedly without end:
06-19 11:19:28.556: DEBUG/dalvikvm(7493): GC_FOR_MALLOC freed 11761 objects / 519744 bytes in 39ms
The only way I found to stop the application from looping is to remove the calendar event. As soon as the calendar event is deleted, the application comes back to life and lists my events, BUT, the list now contains all my events repeating again and again. He never stops like a feed.
My best guess is that on line 333, where the code reads:
String nextLink = feed.getNextLink(); if (nextLink == null) { break;
nextLink never becomes null, thus creating a loop. But why does this happen ONLY when I add a calendar event?
EDIT:
I deleted some calendar events and started working. It seems that if the calendar has more than 25 events, does it begin to loop? What is the meaning of this ?!