android: EXDATE format when adding a calendar event

泪湿孤枕 提交于 2019-11-28 12:23:41

The correct format is:

values.put(Events.EXDATE, "20130116T080000Z");

However you must ensure that it is in UTC time. I was having the same problem starting from PST, so I just had to add 8 hours to get it to work.

I'm adding on top of @kee23's excellent and correct answer:

I just got aware that in android, you can not persist EXDATEs to an event with endless recurrences, say RRULE:FREQ=DAILY. You need to limit the occurrences, as in RRULE:FREQ=DAILY;COUNT=600.

This is not documented by google and there is no error message if you try to persist endless recurrences with EXDATEs. It just silently dropped RRULE and DURATION in my case.

In addition to the @kee23's answer, the next variant is valid for multiple EXDATE values:

contentValues.put(CalendarContract.Events.EXDATE, "20130116T080000Z,20130118T080000Z");
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!