我可以在 rrule 中添加“直到”日期的谷歌日历中的重复事件,如果我在 rrule 中设置“直到”日期,它不会在谷歌日历中创建事件。怎么解决??
我的 ContentValue 是“description=Test title=Monthly Event allDay=0 dtend=1572593453011 dtstart=1572591653011 calendar_id=2 eventLocation=null rrule=FREQ=MONTHLY;BYMONTHDAY=1; UNTIL=1580452756479 ”
如果我直到 rrule 中的值才给出,它被保存到谷歌日历,否则不要保存
val values = ContentValues().apply {
put(CalendarContract.Events.DTSTART, entity.dateTime.startsOn)
put(CalendarContract.Events.DTEND, entity.dateTime.endsOn)
put(CalendarContract.Events.ALL_DAY, if (entity.dateTime.isAllDay) 1 else 0)
put(CalendarContract.Events.TITLE, entity.title.name)
put(CalendarContract.Events.DESCRIPTION, entity.note.content)
put(CalendarContract.Events.CALENDAR_ID, getPrimaryCalendarId())
put(CalendarContract.Events.EVENT_TIMEZONE, Locale.getDefault().toString())
put(CalendarContract.Events.EVENT_LOCATION, entity.location.address)
put(CalendarContract.Events.RRULE,
getRRule())
}
val uri: Uri = activity!!.contentResolver.insert(CalendarContract.Events.CONTENT_URI, values)!!
eventID = uri.lastPathSegment!!.toLong()
print("Event Id $eventID")