0

How do I get fresh list of events from Calendar using ContentResolver?

I have used following line of code for the same

ContentResolver cr = AppController.getInstance().getContentResolver();
Cursor cursor = cr.query(CalendarContract.Events.CONTENT_URI,new String[]{"calendar_id", "title", "description","dtstart", "dtend", "eventLocation", "_id"}, null,null, null);

This returns me list of calendar events, but the problem is, if I manually remove an event from Calendar app and then resume my app, still ContentResolver returns with the same deleted event. But if I force restart my app, then it returns proper data.

Please suggest for any solution to this.

Thanks in advance.

0 Answers0