如何通过 Google 服务清空日历的回收站?
我正在使用 Java 调用 Google 服务 (com.google.api.services.calendar.Calendar
),但我需要在删除事件后清空垃圾箱。
最佳答案
我想我已经找到解决这个问题的唯一方法:
- 创建临时日历
- 将我必须删除的所有 Activity 移入此日历
- 删除临时日历
喜欢这段代码:
Calendar entry = new Calendar();
entry.setSummary("MyTrashCalendar");
Calendar result = client.calendars().insert(entry).execute();
...
Event updatedEvent = client.events().move('currentCalendarId', "eventId", "destinationCalendarId").execute();
...
client.calendars().delete(calendar.getId()).execute();
希望这有帮助
关于java - 如何通过 Google 服务清空日历垃圾箱,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41043053/