Skip to content

Instantly share code, notes, and snippets.

@iewnait
Created June 5, 2012 17:46
Show Gist options
  • Save iewnait/2876517 to your computer and use it in GitHub Desktop.
Save iewnait/2876517 to your computer and use it in GitHub Desktop.
Example code for Calendars.Events.getEventCursorForDay(ContentResolver cr, Time date)
// Set time to the same time tomorrow.
Time date = new Time();
date.setToNow();
date.weekDay = date.weekDay + 1;
Cursor cur = Calendar.Events.getEventCursorForDay(getContext().getContentResolver(),
date
);
while (cur.moveToNext()) {
Calendar.Event event = Calendar.Events.getEventFromCursor(cur);
// Do something useful with this event.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment