将新联系人添加到联系人提供程序时是否会触发意图?

发布于 2024-12-14 13:21:37 字数 149 浏览 2 评论 0原文

我正在寻找一种在设备数据库中添加(或更改)新联系人时收到通知的方法。

从文档中看,似乎有很多意图用于启动添加联系人或附加照片的活动,但当联系人表中的某些内容发生更改时,没有触发任何意图。

任何类型的通知都可以提供帮助,最好是意图。

谢谢

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

缪败 2024-12-21 13:21:37

据我所知,没有触发 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文