I am trying to write a personal manager app which has events from all the calendars in the device. So when I add event I am using CalendarProvider and Intents and passing the control to native calendar so that user can add event details and save it. The events are then automatically loaded to the app. For edit also I have option to invoke Intent using edit mode.
But I am not able to do it for delete, when ever I open it for edit it has option to edit the calendar event details but not delete the events .Is it possible to open the native calendar to delete an event from our app.
Some code that I use to add and edit.
Uri uri = ContentUris.withAppendedId(Events.CONTENT_URI, eventID);
Intent intent = new Intent(Intent.ACTION_INSERT).setData(uri);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
classContext.startActivity(intent);
Uri uri = ContentUris.withAppendedId(Events.CONTENT_URI, eventID);
Intent intent = new Intent(Intent.ACTION_EDIT).setData(uri);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
classContext.startActivity(intent);