日历返回重复的假日活动 [英] Calendar returning duplicate Holiday Events

查看:57
本文介绍了日历返回重复的假日活动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现,当有两个帐户链接到他们的设备,并且两个帐户都同步其日历,并且两个帐户都设置为显示Google假期日历时,则"CalendarContract.Instances"会每个假期返回两次,每个日历一次.因此,在这种情况下,您会看到,除Google日历外,大多数日历应用程序都会两次显示假期",每个日历一次.

I have found, that when has two accounts linked to their device, and both accounts are syncing their calendars, and both accounts are setup to show the Google Holiday calendar, then the `CalendarContract.Instances` is returning each holiday twice, once for each calendar. Therefore you will see in such cases, that most Calendar apps, other than Google Calendar, will show the Holiday twice, once per calendar.

我查看了基础的Sqlite数据库,在日历"表中,每个假期日历都有单独的一行,具有不同的ID.在事件"表和实例"表中,每个假期有2行,每个日历有2行,具有不同的ID.因此,`CalendarContract.Instances`返回了预期的结果.

I looked at the underlying Sqlite database, and in the `Calendar` table, there is a separate row for each holiday calendars, with different ids. In the `Events` table, and in the `instances` table, there are 2 rows for each holiday, one for each calendar, with different ids. So `CalendarContract.Instances` is returning the expected results.

问题是,Google日历如何避免这种情况?它只是通过比较allDay事件的标题而不显示重复项来做到这一点吗?对我来说听起来有点冒险.有什么想法吗?

The question is, how does the Google Calendar avoid this? Does it do it just by comparing the titles of allDay events, and not showing duplicates? Sounds risky to me. Any ideas?

预先感谢

推荐答案

我通过更改基础数据库中的标题进行了一些黑客操作,然后Google日历应用程序确实两次显示了该事件.显然,谷歌应用程序只是在比较详细信息(无论是在代码中还是在查询中),而没有显示看起来像重复的细节.

I did some hacking by changing the title in the underlying database, and then Google Calendar app did show the event twice. So obviously, the Google app, is just comparing details (either in code or in query), and not showing the ones that look like duplicates.

这篇关于日历返回重复的假日活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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