I've been looking through the various posts on how to delete just one instance of a recurring event from my Android 2.3 Phone's calendar, but I haven't been able to find the perfect answer. So far, the best I've come across is :
Uri eventsUri = Uri.parse("content://com.android.calendar/events");
Uri deleteEventUri = Uri.withAppendedPath(eventsUri, String.valueOf(id2));
DeleteEventActivity.context.getContentResolver().delete(deleteEventUri, null, null);
Where id2 is the id of the event I want to delete. The problem I have is that I only want to delete one instance of a recurring event, but this code deletes all occurrences. Is there a way to delete only one instance? Thanks.
If you want to delete the event (either singularly, or for all or past recurring events), select the event title in your calendar, then select the Delete button. You'll be given options to delete a single event, or all or past recurring events. Select one of the available options, then select “OK” to confirm.
Click on the gear icon and then select 'Settings' from the available options. When in the Google Calendar settings menu, look through the left panel and select 'Events from Gmail'. It will be grouped under General tab. Now, untick the checkbox beside 'Show events automatically created by Gmail in my calendar'.
Instances.query()
)ContentValues
. Put your instance's BEGIN value as ...Events.ORIGINAL_INSTANCE_TIME. Put STATUS_CANCELED as ...Events.STATUS
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With