Deleting events from Calendar not being deleted

后端 未结 3 740
一整个雨季
一整个雨季 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:15

    Different versions of android use different URI paths for looking up calendar data. For example, you could use the following constants for android 2.1 and 2.2:

    private static final String URI_VERSION_2_1 = "content://calendar/events";
    private static final String URI_VERSION_2_2 = "content://com.android.calendar/events";
    

    In 4.0 an different method is preferred:

    http://android-developers.blogspot.com/2011/10/ics-and-non-public-apis.html http://developer.android.com/reference/android/provider/CalendarContract.Events.html

    There is a good chance that the Galaxy S3 has at least Android 4.0 on it. This change may account for the code working on an S1, but not an S3.

提交回复
热议问题