Java Android-如何使用“创建重复事件”;直至;你在哪里约会?
我可以在谷歌日历中添加重复事件,但在rrule中设置“直到”日期,如果在rrule中设置“直到”日期,则不会在谷歌日历中创建事件。怎么解决呢 我的内容值是“description=testtitle=Monthly Event allDay=0 dtend=1572593453011 dtstart=1572591653011 calendar\u id=2 eventLocation=null rrule=FREQ=Monthly;BYMONTHDAY=1;直到=1580452756479” 如果我在rrule中的值被保存到google日历之前不给出,否则不要保存Java Android-如何使用“创建重复事件”;直至;你在哪里约会?,java,android,kotlin,google-calendar-recurring-events,Java,Android,Kotlin,Google Calendar Recurring Events,我可以在谷歌日历中添加重复事件,但在rrule中设置“直到”日期,如果在rrule中设置“直到”日期,则不会在谷歌日历中创建事件。怎么解决呢 我的内容值是“description=testtitle=Monthly Event allDay=0 dtend=1572593453011 dtstart=1572591653011 calendar\u id=2 eventLocation=null rrule=FREQ=Monthly;BYMONTHDAY=1;直到=1580452756479”
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")
最终找到的解决方案是,直到接受日期格式为yyyyMMdd'T'HHmmss'Z'的值,例如“20191105T000000Z” 内容值为“描述=测试标题=每月事件全天=0 dtend=1572593453011 dtstart=1572591653011日历_id=2 eventLocation=null rrule=FREQ=每月;BYMONTHDAY=1;直到=20191113T000000Z”