In my app, I want to assocate contacts with other data. The reference to the contact must be as persistent as possible, otherwise the associated data becomes rubbish.
First, am I correct that I should use ContactsContract.Contact.LOOKUP_KEY to access an aggegrate contact?
Assuming the above, then, how persistent is the LOOKUP_KEY? I would like to presume that it stays valid as long as at least one of the underlying raw tables persists. In particular, I’d like it to be persistent regardless if the user:
– changes the name in any of the raw tables
– removes it from a raw table (but not from all raw tables)
– adds it independently to a new raw table.
Are my assumptions valid? If not, any suggestions?
Thanks.
Yes, anything in ContactsContract.Contact is for an aggregate contact.
LOOKUP_KEY persists as long as the aggregate contact itself is there. Use CONTENT_LOOKUP_URI to do queries against ContactsContract.Contact whenever possible.
Are you running into problems?