I have worked out how to add a reminder after setting a CalendarEventEntry using
insertedEntry = myService.insert( postUrl, myEntry )
开发者_如何学Creminder = new Reminder()
reminder.setMethod( Reminder$Method.ALERT )
//foo
insertedEntry.getReminder().add( reminder )
insertedEntry.update()
but if you update it becomes an EventEntry and the getReminder returns null and whatever you do it wipes all reminders
insertedEntry = myService.update(editUrl, myEntry)
can find nothing in the api or docs about this case.
Anyone solved this already??
Did you try to cast the update result ?
BaseEntry updateEntry = myService.update(editUrl, myEntry)
if (updatedEntry instanceOf CalendarEventEntry) {
insertEntry = (CalendarEventEntry) updatedEntry
}
Can't you simply update it with:
insertedEntry.update()
rather than
insertedEntry = myService.update(editUrl, myEntry)
精彩评论