• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Android problem deleting event in calender

kamiomar

Lurker
There is problem deleting event in a calender

I created events manually for the following days.
Monday 12 2010 Sunday 18 2010

I have delete events from the code.

Events Deletion Code:

Code:
Uri calendars = Uri.parse("content://calendar/events");
      try {
                  String[] projection = new String[] { "_id" };
                  Cursor managedCursor = contentResolver.get(calendars, projection, null, null,
                              null);
                  if (managedCursor != null) {
                        if (managedCursor.moveToFirst()) {
                              do {
                                    String[] columns = managedCursor.getColumnNames();
                                    for (int i = 0; i < columns.length; i++) {
contentResolver.delete(Uri.withAppendedPath(calendars, "/" + managedCursor.getString(i)), null, null);
                                    }
                              } while (managedCursor.moveToNext());
                        }
                  }
            } catch (Exception e) {
                  e.printStackTrace();
                  // TODO: handle exception
            }

After running the code Green mark still on the calendar which shows event but these events already deleted when u click on these event it says calender not found. I have attached the screen shot below:
10e7dc1369.png
 
I'm having this problem as well with my implementation. Creating new events works fine, but deletion always fails. Did you manage to solve it?
 
Back
Top Bottom