Galaxy S 上的日历插入未同步到 Google 日历
我有一个应用程序,使用提供程序 content://com.android.calendar/events
将日历事件插入 Android 日历(对于 Android 2.2,否则为 content://calendar/events )。
这通常工作正常,在我的 Nexus One 上,事件已添加并正确同步到 Google 日历。
然而,在 Galaxy S 上,添加到 Google 帐户日历的新事件会正确显示在手机上,但不会同步回 Google 日历。即使在手机设置中强制同步后,新事件也不会出现在 Google 日历中(从网络上查看)。
而在同一部手机上,使用内置三星日历应用程序添加到同一 Google 日历的新事件确实会同步到 Google 日历。
有谁知道如何将新事件从 Galaxy S 同步到 Google?
一些代码:我的实际插入是这样完成的:
Builder b = ContentProviderOperation.newInsert("content://com.android.calendar/events").withValues(values);
ops.add(b.build());
getContentResolver().applyBatch("com.android.calendar", ops);
这类似于库存 Android 日历应用程序的插入方式,如 AOSP EditEvent 类。
I have an app that inserts calendar events into Android calendars using the provider content://com.android.calendar/events
(for Android 2.2, else it is content://calendar/events
).
This works fine usually, and on my Nexus One the events are added and synced correctly up to Google Calendar.
On the Galaxy S however, new events added to a Google Account calendar appear correctly on the phone, but do not sync back to Google Calendar. Even after forcing a sync to occur in phone settings, the new event does not appear in Google Calendar (viewed from the web).
Whereas on the same phone a new event added to the same Google calendar using the built-in Samsung calendar app does get synced up to Google Calendar.
Does anyone know how I can get the new events to sync to Google from a Galaxy S?
Some code: my actual inserts are done like this:
Builder b = ContentProviderOperation.newInsert("content://com.android.calendar/events").withValues(values);
ops.add(b.build());
getContentResolver().applyBatch("com.android.calendar", ops);
This is similar to how the stock Android calendar app does inserts, as seen in the AOSP EditEvent class.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请注意,当您执行诸如编写原始字符串之类的操作时,例如:
您正在使用私有 API。无法保证这适用于任何特定平台或设备,因为这些不是 SDK 的一部分。
目前日历数据库没有公共 API。
Please note, when you do stuff like write raw strings such as:
You are using private APIs. There are no guarantees this will work on any particular platform or device, since these are not part of the SDK.
Currently there is no public API for the calendar database.
通用软件是正确的。三星修改了手机上的日历应用程序。该应用程序不仅使用谷歌、交换和 Facebook 日历,而且还添加了一个名为“我的日历”的“收藏家”日历。
带 TouchWiz 的 Galxy S 上的日历应用程序有问题。有些事情有效,有些则无效。有一个已知错误会显示全天事件在前一天结束。在2.2正式更新发布之前,这个日历是不可靠的。
其他电话公司也可能对他们的手机做同样的事情,因为正如 @hackbod 指出的那样,日历数据库没有公共 API。
Commonsware is correct. Samsung has modified the calendar app on their phones. The app uses not only the google, exchange, and facebook calendars, but they have also put in a 'collecter' calendar called My Calendar.
The calendar app on the Galxy S with TouchWiz is buggy. Some things work, some do not. There is a known bug that shows all day events ending on the previous day. Until the official update to 2.2 is released, this calendar is unreliable.
Other phone companies may also do the same with their phones because as @hackbod points out there is no public API for the calendar database.