4

I am working an app that read Events of a given 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 synched to google calendar or Exchange Server mailbox. I am able to get the event using the code above, but the I noticed that Events.UID_2445 attribute is never populated.

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

Using google calendar data api and exchange web services, I have confirmed that it has ICAL UID attribute populated. It looks like calendar sync does not store that attribute in the Event object. Does anyone else have the same issue or do you see anything wrong with the code that I use? Thanks

  • I've filed a but report. Please star: https://code.google.com/p/android/issues/detail?id=179301 – Jeff Lockhart Jul 08 '15 at 00:11
  • Refer https://developer.android.com/reference/android/provider/CalendarContract.EventsColumns.html#UID_2445 . This may help you. – Aditi Feb 27 '19 at 12:54

0 Answers0