From: Marius Gavrilescu Date: Wed, 29 May 2013 09:21:24 +0000 (+0300) Subject: Add delete method to Event X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=4b8bd2f81a7457106a029fc06c3efd5a70a65703;p=unical.git Add delete method to Event --- 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;