【问题标题】:How to use the extended properties to filter the events using list google calendar API?如何使用扩展属性通过列表谷歌日历 API 过滤事件?
【发布时间】:2021-05-03 07:17:15
【问题描述】:

我正在使用List Google calendar API 过滤在 android 应用程序中使用扩展属性创建的事件。没有关于如何在列表 API 中使用它的文档。 API 资源管理器允许将其用作查询参数,但 java 代码未显示如何使用扩展属性进行过滤。请帮忙。 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"); 

如何使用列表命令的查询参数?

【问题讨论】:

    标签: google-apis-explorer


    【解决方案1】:

    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);
    

    【讨论】:

      猜你喜欢
      • 2019-01-21
      • 1970-01-01
      • 1970-01-01
      • 2016-01-17
      • 2014-09-19
      • 2015-01-14
      • 2023-03-14
      • 2013-12-05
      • 2017-05-24
      相关资源
      最近更新 更多