Android, calendar, adding RRULE to event never works

android, android-calendar

Solution

I figured it out, the RRULE string shouldn't contain the word 'RRULE' itself.

Problem

I'm following rfc2445 spec and insert a recurrent event to cal, but always get invalid recurrence error. `Invalid recurrence rule: RRULE:FREQ=WEEKLY;UNTIL=20141007T000000Z;WKST=SU;BYDAY=TU,TH` This is my code, note I return the above constant rrule string to make sure I don't violate the specs, I just change the year from 1997 to 2014. Any idea why it doesn't work? thanks ``` ContentResolver cr = getContentResolver(); ContentValues values = new ContentValues(); values.put(CalendarContract.Events.DTSTART, model.getStartTime().toMillis(false)); values.put(CalendarContract.Events.DTEND, model.getEndTime().toMillis(false)); values.put(CalendarContract.Events.EVENT_TIMEZONE, timezone); values.put(CalendarContract.Events.TITLE, model.getTitle()); values.put(CalendarContract.Events.EVENT_LOCATION, model.getLocation().getName()); values.put(CalendarContract.Events.DESCRIPTION, model.getDescription()); values.put(CalendarContract.Events.CALENDAR_ID, calId); String recurString ="RRULE:FREQ=WEEKLY;UNTIL=20141007T000000Z;WKST=SU;BYDAY=TU,TH" values.put(CalendarContract.Events.RRULE, recurString); Uri uri = cr.insert(CalendarContract.Events.CONTENT_URI, values); ```

Original source

Related problems