且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

删除在Android日历提供事件

更新时间:2023-12-03 14:11:46

正如您所注意到,删除一个事件并没有真正从数据库中删除行,直到事件被同步到服务器。 这是很合乎逻辑的,否则日历同步适配器将无法检索事件数据发送一个DELETE请求到服务器。这就是为什么出现在事件表中删除的列,您的必须的检查查询事件时:

As you noticed, deleting an event doesn't really remove the row from the DB until the event is synced to the server. It's quite logical, otherwise the calendar sync adapter would not be able to retrieve event data to send a DELETE request to the server. That's why there is a DELETED column in the event table, which you must check when querying events:

http://developer.android.com/reference/android/provider/CalendarContract.SyncColumns.html#DELETED

顺便说一句,如果你查询实例,而不是事件(这确实扩大经常性的事件),删除事件从结果中自动删除。

By the way if you query Instances instead of Events (which does expansion of recurring events), deleted events are removed automatically from the result.