I have experienced your same problem. What you need to do is:
1. Using the default address get the list of all calendars the same
way the documentation states
Now you have a collection of CalendarEntries
2. Traverse the collection of CalendarEntries and for each entry get
the first Link out of the list
of links. Use this link to access calendars
...
CalendarFeed calFeed = (CalendarFeed)service.getFeed(defaultURL,
CalendarFeed.class);
List<CalendarEntry> entries = calFeed.getEntries();
for (CalendarEntry clEn: entries )
{
List<Link> lnks = clEn.getLinks();
for ( int j=0;j<lnks.size();j++ ){
// use lnks.gtet(0) to access all calendars
URL url = new URL
( lnks.get(j).getHref() ); //
Note that only lnks.get(0)
//
will build a URL which in turn
//
returns calendars
//
I do not know the meaning of the
//
other URL
CalendarQuery query = new CalendarQuery (url);
new
CalendarEventFeed().declareExtensions(service.getExtensionProfile());
CalendarEventFeed evFeed = service.query(query,
CalendarEventFeed.class);
List<CalendarEventEntry> en = evFeed.getEntries();
for ( CalendarEventEntry e: en ) {
// you are now visiting the calendar
}
...
}
}
Is this what you need?
Cheers!
Jay
On Apr 13, 11:34 am, "Ivan" <[EMAIL PROTECTED]> wrote:
> I'm having a problem to access non-default calendars. When I used my
> default
> calendar, everything I tried worked just fine.
>
> First, I used the example in the official documentation
> to retrieve all calendars. Once I had that,
> I tried using the EditLink, the SelfLink, and several combinations
> adding "private" and "full". None of them seems to work.
>
> I read several posts regarding the same problem.
>
> I think our problems would be solved if anyone could post
> an example function like the following:
>
> void printListOfTasks (String username, String password, String
> calendarName) {...}
>
> that actually works.
>
> Many thanks in advance.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Calendar Data API" group.
To post to this group, send email to [EMAIL PROTECTED]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/google-calendar-help-dataapi?hl=en
-~----------~----~----~----~------~----~------~--~---