Android Calendar Provider exception on recurring events

浪子不回头ぞ 提交于 2019-12-11 08:12:17

问题


I try to utilize the CalendarContract content provider: http://developer.android.com/reference/android/provider/CalendarContract.Events.html

I only can't seem to find anything regarding exception on recurring events.
I use the Instances URI to query.
I added an event (on calendar.google.com) and made it repeat every day. Now I changed one of the instances' time and the content provider gives me the exception correctly:

// Original event instance:
    eventID: 320
    instanceID: 651
    startdate: Wed Mar 13 09:30:00 CET 2013
    rrule: FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR
    original_event_id: null
    exrule: null
    exdate: null

// Exception event instance:
    eventID: 333
    instanceID: 888
    startdate: Mon Mar 18 15:00:00 CET 2013
    rrule: null
    original_event_id: 320
    exrule: null
    exdate: null

As you can see above the original event has no exrule and exdate but the exception event is still shown correctly (not overlapping the original event instance)

Now here comes my question: I want to add an exception to a recurring event myself. But I don't know what fields I need to fill and how this works. Since the example above isn't helpful at all.


回答1:


I was a bit too hasty posting this question. Inserting events to the CalendarContract.Events.CONTENT_EXCEPTION_URI will handle all of this ...



来源:https://stackoverflow.com/questions/15478473/android-calendar-provider-exception-on-recurring-events

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