0

I'm currently updating my events with the following command:

contentResolver.update(ContentUris.withAppendedId(Events.CONTENT_URI,eventId),values,null,null)

After this, by querying my instances with

adb shell content query --uri content://com.android.calendar/instances/when/1598918400000/1599091200000 --where "calendar_id=\'3\'" --projection calendar_id:title:_id:event_id

the modified event instance is also immediately available!

However, if I update an event (just the title) and containing a rrule, the event itself gets updated, but the instances do not!

adb shell content query --uri content://com.android.calendar/events --where "calendar_id=\'3\'" --projection calendar_id:title:_id

contains my latest modifications, but

adb shell content query --uri content://com.android.calendar/instances/when/1598918400000/1599091200000 --where "calendar_id=\'3\'" --projection calendar_id:title:_id:event_id

is then empty for the recurring events

Somehow and I don't know why, but if I delete any other recurring event, my instances get recreated, and contain then the correct instances from the recurrent event before.

So my current solution and which I DON'T LIKE, is inserting a temporary fake recurrent rule, after the modify, and then immediately delete it again...

Does anybody know, what I'm doing wrong, and why this only happens for recurring events ?

1 Answers1

0

I finally found the reason... The reason was the same than in this stackoverflow link Android: Not All Instances of Recurring Event Saved

When you update/insert your recurring event, make sure that you did not query the instances shortly before with a bad start and end date...

If you do, it results, that your recurring event will be saved, but you can't query correctly... It seems a bad start/end query breaks the instance querying system for a while... A delete of another recurring event or opening the official google calendar app, seems to recover this state...