ContentObservers 没用
我希望能够了解短信或通话记录中的特定项目何时发生更改。当适当的内容提供商发生变化时,很容易收到通知,但获取特定记录的效率很低,因为需要维护商店的整体镜像,然后找出差异。这不仅是蹩脚的。 “哦,这个包含 800 个项目的表中的某些内容发生了变化,但我们将让您不仅要弄清楚该项目,还要弄清楚该项目已更改的实际属性”有什么用处。
也许比我聪明的人可以告诉我如何在特定通话记录、短信或联系人记录发生更改时收到通知。我很想知道联系人提供商何时获得显示名称的更新。或者当某个联系人被标记为“收藏夹”时。
我想知道当联系人提供程序获得显示名称或某些其他属性(例如“收藏夹”)的更新时如何检测/获取通知。我的服务对这些变化感兴趣,因为它会做一些事情来响应这些变化。
I'd love to be able to understand when a SPECIFIC item in the SMS or Call Log is changed. It's pretty easy to get notified when something changes in the appropriate content provider, but getting to the specific record is totally inefficient as one needs to maintain a total mirror image of the store and then figure out the diff. This is not only lame. What use is a notifcation for "oh something has changed in this table of 800 items, but we'll leave it to you to figure out not just the item, but the actual attribute/attributes for that item that have changed."
Perhaps someone smarter than me can tell me how to get notifed when a SPECIFIC call log, sms or contact record has changed. I'd love to know when the contact provider gets an update for a display_name. Or when a contact has been marked as a 'favorite'.
I'd like to know how to detect/get notifide when the contacts provider gets an update for a display_name or some other attribute such as 'favorite'. My service is interested in these changes as it will do something in response to these kinds of changes.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
无法通知 ContentObservers SMS 或呼叫日志中的特定项目。
获取特定项目通知的唯一方法是使用 ( ContentResolver.notifyChange ) 在 SMS 或呼叫日志 ContentProvider 代码中更改单个项目的 nofifyChanges。
ContentObservers cannot be notified for SPECIFIC item in the SMS or Call Log.
The only way to get notification for SPECIFIC item is to make changes in SMS or Call Log ContentProvider code to nofifyChanges for individual Item using ( ContentResolver.notifyChange ).