I am using the following code:
String selection = "((dtstart >= " + now
+ ") AND (dtend <= " + endTime.getTimeInMillis() + "))";
Cursor cursor = context.getContentResolver()
.query(Uri.*parse*("content://com.android.calendar/events"),
*PROJECTION*, selection,null, null);
And I notice that once I add/remove an Event
to Google Calendar app on the device and run the above code immediately, occasionally I do not get the latest dataset from the Cursor
. I have to manually refresh the Google Calendar app to get the latest data.
Am I missing something? Can I use some other APIs?
Thanks!