Deleting events from Calendar not being deleted

后端 未结 3 689
一整个雨季
一整个雨季 2021-02-05 03:36

I am trying to make my App add reminders to the user\'s Calendar. The code searches for the title and start date to check if the event already exists i

3条回答
  •  别跟我提以往
    2021-02-05 04:11

    If its not a URI problem,

    Can you try to include in the selection string

    AND (deleted != 1)
    

    so the selection string becomes,

    String selection = "((" + "calendar_id" + " = 1) AND ("
        + "title" + " LIKE '"+name+"') AND ("
        + "dtstart" + " = "+String.valueOf(c.getTimeInMillis())+") AND ( deleted != 1 ) )";
    

    Occasionally, the CalendarDB takes sometime for the events to be removed. But the 'deleted' COLUMN will be marked as '1' indicating that they will be deleted soon. The reason for the delay maybe the calendar is waiting to be synced

    p.s: Try using this tool -- http://www.cellobject.net/Tools/CellObjectSQLiteXMLBrowser.aspx to visualize the Calendar DB. Please check for the 'deleted' and 'dirty' columns in the db

提交回复
热议问题