Android Calendar Recurring Events Have Wrong End Date/Time

后端 未结 3 2126
再見小時候
再見小時候 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 21:05

    beginTime and endTime can be 0/null because you got them from a wrong database, certainly from events database. You should use the instances database instead (ex: "content://com.android.calendar/instances/when/" on SDK 8).

    In the instances DB, you'll get all "real" events : There, each recurring event has as many instances as needed, with correct begin and end timestamps; and the other events are visible too. You only have to read these fields - event_id, begin, end - and use them to open your Intent.

提交回复
热议问题