android - 如何在 Google 日历事件中存储自定义属性?

标签 android google-api google-calendar-api

是否可以在 Google 日历事件中存储自定义属性(一个简单的字符串)?

我试过这个:

// inserting
Event event = new Event();
event.setSummary("test event");
event.set("customProperty", "custom value");
// event.get("customProperty") correctly returns "custom value" here
...
calendarService.events().insert("primary", event).execute();

// obtaining
Events events = calendarService.events().list("primary"). ... .execute();
List<Event> items = events.getItems();
for (Event event : items) {
    String result = (String) event.get("customProperty");
}

它使用正确的summary 创建事件,但result(我的自定义属性)始终为空。

最佳答案

您可以为此使用扩展属性 (https://developers.google.com/google-apps/calendar/v3/reference/events#extendedProperties),因为它们是通用键值存储。

根据您是否希望属性在查看事件的 guest 副本时可用,您应该选择共享或私有(private)扩展属性。

关于android - 如何在 Google 日历事件中存储自定义属性?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32159878/

相关文章:

android - 在 DDMS 下,Google Glass 未显示为 eclipse 上的设备。

google-api - Google Custom Search Api 不断给我 "usageLimits"错误

google-api - 使用圆形边框和切片边距自定义 Google Visualization PieChart 外观

php - 如何在开源(Github + Heroku)应用程序中保护 Google API Key

Android studio - Google Play 游戏服务登录失败

android - 看不到我的 chrome 设备 ://inspect/#devices

android - phonegap-facebook-插件 : only works when native FB app is not installed (Android)

YouTube API - 列出我管理的所有 channel

google-apps-script - 获取所有同事日历的列表

c# - 找不到 sendNotifications 选项 Google Calendar api v3 .NET