Use update instead of delete + insert
[unical.git] / src / ro / ieval / unical / Event.java
index 6b39cb3ce9722b18f6f0e61860bd4dbbd82b679d..9357776ffbf4705dec7189d8be12e22ed6103642 100644 (file)
@@ -144,6 +144,16 @@ final class Event implements Parcelable{
 
         Uri url = context.getContentResolver().insert(Events.CONTENT_URI, cv);
     }
+    public void edit(final Context context) {
+        ContentValues cv = new ContentValues();
+        cv.put("calendar_id",calendarID);
+        cv.put("title",title);
+        cv.put("description",description);
+        cv.put("dtstart",dtstart);
+        cv.put("dtend",dtend);
+        cv.put("eventTimezone", TimeZone.getDefault().getID());
+        context.getContentResolver().update(Events.CONTENT_URI,cv,"_id = '" + String.valueOf(_id) + "'",new String[0]);
+    }
 
        public void delete(final Context context){
                final ContentResolver cr=context.getContentResolver();
This page took 0.010002 seconds and 4 git commands to generate.