如何使用 Android 中的自定义同步适配器删除联系人?
我编写了一个使用自定义联系人同步适配器的应用程序,它非常适合同步/添加/编辑联系人。但是,我不知道如何在本地设备上删除联系人时通知我的应用程序(或同步适配器服务)。现在的场景如下:
- 用户使用本机通讯录应用程序删除联系人
- 该联系人被标记为删除并从我的自定义同步适配器中删除(它不再显示在通讯录应用程序中)
- 在下次同步期间,我的同步适配器可以看到该联系人已标记为删除,但没有时间戳来知道何时完成此操作
我希望当用户在步骤 1 中删除联系人时通知我的应用程序,然后立即处理该删除。这怎么能做到呢?
谢谢。
I wrote an app that uses a custom sync adapter for contacts, and it works perfectly for synching / adding / editing contacts. However, I can't figure out how t get my app (or the sync adapter service) to be notified when a contact was deleted on the local device. Here is the scenario now:
- A user deletes the contact using the native Contacts app
- That contact gets marked for deletion and removed from my custom sync adapter (it no longer shows up in the Contacts app)
- During the next sync, my sync adapter can see that the contact was marked for deletion, but there is no timestamp to know when this was done
I would like to have my app notified when the user deletes the contact in Step 1, and then immediately process that deletion. How can this be done?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论