开发者

add reminder to Google Calendar

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜