From 4b8bd2f81a7457106a029fc06c3efd5a70a65703 Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Wed, 29 May 2013 12:21:24 +0300 Subject: [PATCH] Add delete method to Event --- src/ro/ieval/unical/Event.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ro/ieval/unical/Event.java b/src/ro/ieval/unical/Event.java index 38dd137..095d07a 100644 --- a/src/ro/ieval/unical/Event.java +++ b/src/ro/ieval/unical/Event.java @@ -3,6 +3,7 @@ package ro.ieval.unical; import android.content.ContentResolver; import android.content.Context; import android.database.Cursor; +import android.net.Uri; import android.os.Parcel; import android.os.Parcelable; import android.provider.CalendarContract.Events; @@ -74,6 +75,11 @@ final class Event implements Parcelable{ return events; } + public void delete(final Context context){ + final ContentResolver cr=context.getContentResolver(); + cr.delete(Uri.withAppendedPath(Events.CONTENT_URI, Long.toString(_id)), null, null); + } + @Override public int describeContents() { return 0; -- 2.39.2