使用oauth2和日历Api v3将事件更新为Google日历。但我找不到任何例子。 我有这样插入并阅读所有事件
{{1}}
但我有更新事件吗?
答案 0 :(得分:0)
Works Thanx给予链接@DalmTo
import com.google.api.services.calendar.Calendar;
import com.google.api.services.calendar.model.Event;
// ...
// Initialize Calendar service with valid OAuth credentials
Calendar service = new Calendar.Builder(httpTransport, jsonFactory, credentials)
.setApplicationName("applicationName").build();
// Retrieve the event from the API
Event event = service.events().get("primary", "eventId").execute();
// Make a change
event.setSummary("Appointment at Somewhere");
// Update the event
Event updatedEvent = service.events().update("primary", event.getId(), event).execute();
System.out.println(updatedEvent.getUpdated());