Skip to content Skip to sidebar Skip to footer

Is It Possible To Remove The Android Calendar Event

I am using the Android calendar. How can I remove a calendar event using code? Is it possible? For clarification, I would like to mention that I don't want a sync process or want t

Solution 1:

Try this to delete the event using Uri of the event id.

Uri uri='URI OF THE EVENT';
getContentResolver().delete(uri, null, null);

Solution 2:

A short way:

UrieventUri= Uri.parse("content://calendar/events");  // or "content://com.android.calendar/events" Cursorcursor= contentResolver.query(eventUri, newString[]{"_id"}, "calendar_id = " + calendarId, null, null); // calendar_id can change in new versions while(cursor.moveToNext()) {
    UrideleteUri= ContentUris.withAppendedId(eventUri, cursor.getInt(0));

    contentResolver.delete(deleteUri, null, null);
}

Solution 3:

There is no such concept as "remove local calendar's event":

  • There is no "local calendar". There is, at most, a cached representation of the user's Google Calendars.
  • The Calendar application is not part of the SDK

Solution 4:

Post a Comment for "Is It Possible To Remove The Android Calendar Event"