Android CalendarContract.Events.UID_2445 not populated

I am working on an application that reads the Events of this calendar.

public static final String[] EVENT_PROJECTION = new String[] { Events._ID, // 0 Events.UID_2445, //1 Events.DTSTART, // 2 Events.DTEND }; // 3 // The indices for the projection array above. private static final int PROJECTION_ID_INDEX = 0; private static final int PROJECTION_UID_INDEX = 1; ... ContentResolver contentResolver = ctx.getContentResolver(); Uri uri = Events.CONTENT_URI; Cursor cur = contentResolver.query(uri, EVENT_PROJECTION, Events.CALENDAR_ID + " = ?", new String[] { String.valueOf(calendarId) }, null); 

The calendar is synchronized with a Google calendar or an Exchange Server mailbox. I can get the event using the code above, but I noticed that the Events.UID_2445 attribute is never populated.

  String uid = cur.getString(PROJECTION_UID_INDEX)); //this line always returns null 

Using Google api calendar data and exchanged web services, I confirmed that it has the ICAL UID attribute. It seems that calendar synchronization does not store this attribute in the Event object. Does anyone else have the same problem or are you seeing something wrong with the code I'm using? Thanks

+4
source share

All Articles