Why duration is NULL for recurrent event in android?
Asked Answered
P

1

2

I try to implement one way synchronization with android calendar events (I need original events - not event instances). So, I have the following query:

String[] projection = new String[]{
                    CalendarContract.Events.DTSTART,
                    CalendarContract.Events.EVENT_TIMEZONE,
                    CalendarContract.Events.DTEND,
                    CalendarContract.Events.EVENT_END_TIMEZONE,
                    CalendarContract.Events.DURATION
            };
String selection = null;
String[] args = new String[0];
String sort = CalendarContract.Events.DTSTART + " ASC";
Cursor cursor = getContentResolver().query(CalendarContract.Events.CONTENT_URI, projection, selection, args, sort);

According to developer docs for recurrent events dtstart and duration are required but when I create event through Google calendar and receive it later in my code I have dtend = 0 and duration = null.

Integer dtend = cursor.getLong(2);
String duration = cursor.getString(4);

Why it may happen?

Peridium answered 24/10, 2016 at 15:13 Comment(0)
P
0

I have an issue with indexes in my original application. CalendarContract.Events.DURATION column solves the problem. It has single event duration in RFC2445 format. I just need to parse it.

Peridium answered 25/10, 2016 at 10:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.