I use following code:

ContentResolver contentResolver=this.getContentResolver();

Uri.Builder builder = Uri.parse("content://calendar/instances/
when").buildUpon();
long now = new Date().getTime();
ContentUris.appendId(builder, now - DateUtils.WEEK_IN_MILLIS);
ContentUris.appendId(builder, now + DateUtils.WEEK_IN_MILLIS);

Cursor eventCursor = contentResolver.query(builder.build(),
        new String[] { "title", "begin", "end", "allDay"}, null,
        null, "startDay ASC, startMinute ASC");

while (eventCursor.moveToNext()) {

    String title = eventCursor.getString(0);
    Date begin = new Date(eventCursor.getLong(1));
    Date end = new Date(eventCursor.getLong(2));
    Boolean allDay = !eventCursor.getString(3).equals("0");

}

How can I check which type of events I got? Private (from device) or
Public (from Google)?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to