简体   繁体   English

Android:如何删除重复事件

[英]Android: how to delete recurring events

I'm building a calendar provider that is synchronizing calendar events with server. 我正在建立一个日历提供程序,它将日历事件与服务器同步。 When I try to delete an event it is working fine if the event is non-recurring. 当我尝试删除事件时,如果该事件是非重复发生,则可以正常工作。 When I try to delete recurring event it does not show me any error or anything, but all the events from the calendar disappear. 当我尝试删除重复事件时,它不会显示任何错误或任何内容,但是日历中的所有事件都会消失。 The log doesn't show me any error after that, it gives me all standard logs only, but nothing appears on the calendar after that. 此后日志不显示任何错误,它仅显示所有标准日志,但此后日历上没有任何内容。 Here is my code that I use for deleting all the events (recurring and non-recurring): 这是我用于删除所有事件(重复发生和非重复发生)的代码:

resolver.delete(ContentUris.withAppendedId(Events.CONTENT_URI, id), null, null);

where resolver is the ContentResolver and id is the id of the event in the database. 其中resolverContentResolverid是数据库中事件的ID。

It was my mistake. 是我的错 The above code is working fine for deleting events 上面的代码可以正常删除事件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM