Listen for changes to individual android contacts -


i have list of phone numbers , need notified when changes occur contacts numbers in android contacts database.

what tried far:

1st method: register contentobserver:

getcontentresolver().registercontentobserver( uri.withappendedpath(contactscontract.contacts.content_lookup_uri, lookupkey), false, mpresenceobserver); 

, mpresenceobserver contentobserver. way change notifications in "onchange" method of observer, happens when change occurs contact in database, not ones interested in. uri comes in "onchange" looks this: "content://com.android.contacts" (so not have appended ids me identify contact changed).

2nd method: query database retrieve contacts interested in , set contentobserver on cursor. unfortunately, same thing happens in previous method: notified when any change occurs database, instead of being notified when change data backs cursor happens.


Comments

Popular posts from this blog

rdbms - what exactly the undo information lives in oracle? -

bash - How do you programmatically add a bats test? -

java - Getting exception in JDBC thin driver -