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?