开发者

add reminder to Google Calendar

开发者 https://www.devze.com 2023-01-19 22:38 出处:网络
I have worked out how to add a reminder after setting a CalendarEventEntry using insertedEntry = myService.insert( postUrl, myEntry )

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

精彩评论

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

关注公众号