java - Problem with Google Calendar API "getTimes()" method -


I am trying to get many information from the Google Calendar API in Java. I have a problem while trying to access information about the timing of an incident. I do the following:

  calendar service my service = new calendar service ("project_name"); MyService.setUserCredentials ("User", "PWD"); URL feedUrl = New URL ("http://www.google.com/calendar/feeds/default/private/full"); CalendarQuery q = new calendarCallery (feedUrl); Calendar EventFeed results = myService.query (q, Calendar EventFeed.class); For (int i = 0; i & lt; resultFeed.getEntries (). Size (); i ++) {Calendar Event Entry G = ResultsFeed.getAntrans (). Obtain (i); & Lt; When & gt; T = G.Gate Times (); // other tasks}  

The list obtained with GetTimes () on the Calendar Event Entry is Always empty and I do not know why it seems strange to me Ever since a calendar event, it always describes the situation when it should be ... what am I missing ??

You should be aware or have a recurring event vs once the event:

gettimes is used once for events.

For recurring events you have to use the getRecurrence ()

or you can set the single objects to correct property, so recurring events are returned as an event and getTimes will return a non-empty list:

  calendarclaim q = new calendar compilation (feedUrl); Q.setStringCustomParameter ("single events", "true"); Calendar EventFeed results = myService.query (q, Calendar EventFeed.class); // Process the results as a single-event now ...  

Reference: Search for "Ekalents" text.

Note: If you use a magic cookie url to access the feed, then recurring events are always returned as recurring events, even if you query singleevents How to set the property.


Comments