2

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);
Bala Sivagnanam
  • 863
  • 1
  • 15
  • 30

1 Answers1

2

I am not sure If it is possible to get a delete view. But When I pass it as ACTION_VIEW I could get the actions associated with it Share, Edit and delete for the events that are created by me in my calendars and can get only Share for the events created by others.

So basically I didn't notice the actions triggered for different types of events.

So for others who are stuck in this kind of problem, if you need all allied actions for your event, best go is to throw them to native calendar in view mode..

Bala Sivagnanam
  • 863
  • 1
  • 15
  • 30