Android Calendar Recurring Events Have Wrong End Date/Time

后端 未结 3 2107
再見小時候
再見小時候 2021-01-15 20:32

This is my code to view an event selected from a ListActivity (events is the ArrayList containing all those events):

Uri viewUri = Uri.parse(\"c         


        
3条回答
  •  星月不相逢
    2021-01-15 20:58

    While working with calendar events, I found out that the events table in the calendar.db stores information of normal events as you have used. (I guess you are using startTime for Dtstart and endTime as Dtend)

    But in case of Recurrence events, Dtend will be null. So instead use lastDate column for the same since this column is never null. It will work well both in the case of recurrence events as well as for normal events.

    But if you require more info on the recurrence events, use Instances table (like the exact start and end time for each of the occurrences) as suggested by @GeH.

提交回复
热议问题