- final ContentResolver cr=context.getContentResolver();
- //cr.insert(Uri.withAppendedPath(Events.CONTENT_URI));
- //cr.notifyChange();
+ 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());
+
+ 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]);