【发布时间】:2013-01-20 09:02:10
【问题描述】:
我真的不明白为什么内容观察者会监听与联系信息无关的变化。
我只是注册到我想听变化的 URI:
getContentResolver().registerContentObserver(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, true, contactsObserver);
但是在给某人打电话或给某人发短信后,它会触发并调用 ContentObserver 中的 onChange 方法。所以我需要将所有联系人列表与我的应用程序重新同步,尽管我不需要这样做。
只有我感兴趣的领域:
- ContactsContract.CommonDataKinds.Phone.CONTACT_ID
- ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME
- ContactsContract.CommonDataKinds.Phone.NUMBER
我应该实施什么样的更改来监听此数据库项的更改?
【问题讨论】:
-
有任何解决方案,如果是,请指导我..自上周以来我遇到了同样的问题
-
@user3475052 您可能对最近的回答感兴趣。
-
仍然面临这个问题。
标签: android android-contacts contentobserver android-query