Reputation: 4632
I try to get the events which are not in the primary calendar (Meeting only).
I am wiring it in Java (Android). What I did:
// List the next 10 events from the primary calendar.
List<EventDetail> eventDetails = new ArrayList<>();
Events events = mService.events().list("primary")
.setMaxResults(10)
.setTimeMin(now)
.setTimeMax(end)
.setOrderBy("startTime")
.setSingleEvents(true)
.execute();
Upvotes: 2
Views: 785
Reputation: 4632
I found the solution -
CalendarList calendarList = mService.calendarList().list().execute();
List<CalendarListEntry> list = calendarList.getItems();
for (CalendarListEntry calendarListEntry : list) {
System.out.println(calendarListEntry.getSummary());
Log.d(TAG, "Calender Id: " + calendarListEntry.getId());
}
Upvotes: 3
Reputation: 1472
Basically you have to go through all the calendars for the particular account and decide which one you would like to get the events from. Then pass the particular calendar Id to the events table or instance table to obtain events.
As from your picture, one account may have more than one calendars.
Upvotes: 1