如何调用同步谷歌日历 [英] how to call sync google calendar

查看:141
本文介绍了如何调用同步谷歌日历的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先阅读以下问题

<一个href=\"http://stackoverflow.com/questions/18774394/delete-events-from-calendar-provider-on-android\">delete从Android上

亚姆有同样的问题...所以我删除事件及其日历仍清晰可见......让它让它消失,我必须点击菜单按钮,preSS同步......

iam having the same problem... so i delete an event and its still visible in calendar ...to make it to make it disappear,i have to tap menu button and press "synchronize" ...

那么,有没有以编程方式调用它呢?

so is there any way to call it programmatically ?

我会问他有,但我没有信誉50:(

i would ask him there but i dont have 50 reputation :(

//或至少voteup我的问题,所以我可以问他有:D

// or at least voteup my question so i can ask him there :D

推荐答案

正如您所注意到,删除一个事件并没有真正从数据库中删除行,直到事件被同步到服务器。这是相当合乎逻辑的,否则日历同步适配器将无法检索事件数据发送一个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:

<一个href=\"http://developer.android.com/reference/android/provider/CalendarContract.SyncColumns.html#DELETED\" rel=\"nofollow\">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.

强制同步也只是一个黑客,因为反正网络可能无法使用...

Forcing synchro would just be a hack, as anyway the network may not be available...

这篇关于如何调用同步谷歌日历的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆