将新联系人添加到联系人提供程序时是否会触发意图?
我正在寻找一种在设备数据库中添加(或更改)新联系人时收到通知的方法。
从文档中看,似乎有很多意图用于启动添加联系人或附加照片的活动,但当联系人表中的某些内容发生更改时,没有触发任何意图。
任何类型的通知都可以提供帮助,最好是意图。
谢谢
I'm looking for a way to get notified when a new contact is added (or changed) in the device db.
From looking in the documentation it looks like there are a lot of intents used to start activities that add contacts or attach photos but there isn't an intent fired when something is changed in the contacts tables.
Any kind of notification can help, preferably an intent.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
据我所知,没有触发 Intent,因为数据库是 SQLite 数据库。
您可以做的是管理自定义 CursorAdapter 并操作 <代码>OnDataSetChanged。这应该会告诉您数据集何时发生更改,但您需要非常小心,以避免数据库死锁。
如果您更详细地描述您要解决的问题,我也许能够给出更好的答案!
希望这有帮助。
There is not an Intent fired, as far as I know, since the DB is an SQLite DB.
What you might be able to do is manage a custom CursorAdapter and manipulate
OnDataSetChanged
. This should tell you when your data set is changed, but you will need to be very careful in order to avoid database deadlock.I might be able to give a better answer if you describe the problem you are trying to solve in more detail!
Hope this helps.