Android examples for Android OS:Calendar Event
Delete event from Calendar
import android.content.ContentResolver; import android.content.ContentUris; import android.content.ContentValues; import android.content.Context; import android.database.Cursor; import android.net.Uri; import android.os.Build; import android.provider.CalendarContract; import android.provider.CalendarContract.Attendees; import android.provider.CalendarContract.Calendars; import android.provider.CalendarContract.Events; import android.provider.CalendarContract.Reminders; import android.util.Log; import java.util.ArrayList; import java.util.List; public class Main{ /**/*from w ww.java2 s. c o m*/ * Delete event */ public static int deleteEvent(CalendarRequest crx) throws Exception { ContentResolver cr = crx.getContext().getContentResolver(); Uri deleteUri = ContentUris.withAppendedId( CalendarContract.Events.CONTENT_URI, crx.getEventID()); int y = cr.delete(deleteUri, null, null); return y; } }