How to use the extended properties to filter the events using list google calendar API?

Viewed 262

I am using List Google calendar API to filter the events which are created with the extended properties in an android app. There is no documentation as to how to use it in the list API. API explorer allows to use it as a query parameter but the java code doesn't show how to filter with extended properties. Please help. TIA.

mService = new com.google.api.services.calendar.Calendar.Builder(
                    HTTP_TRANSPORT, JSON_FACTORY, credential)
                    .setApplicationName("Google Calendar API Android Quickstart")
                    .build();
mService.Events.list("primary"); 

How do i use the query parameters for the list command?

1 Answers

Class Calendar.Events.List

         List<String> sharedList = new ArrayList<>();
            sharedList.add("key=value");
            String pageToken = null;
            do {
                Events events = mService.events().list("primary")
                        .setSharedExtendedProperty(sharedList)
                        .setPageToken(pageToken).execute();
                List<Event> items = events.getItems();
                for (Event event : items) {
                   // doActiofiltered events 
                }
                pageToken = events.getNextPageToken();
            } while (pageToken != null);
Related