A LOOKUP_KEY
is not meant to be used as a key on its own, instead it should be used together with a contact's _ID
to form a full lookupUri
.
The lookupUri
can then be used to find a contact in CONTENT_LOOKUP_URI
tables.
The CONTENT_LOOKUP_URI
basically first looks for the contact by _ID
, if it fails to find it, or the _ID
seems like the wrong contact, it uses hints from the LOOKUP_KEY
part to try and track down the correct contact for you.
From CONTENT_LOOKUP_URI
A content:// style URI for this table that should be used to create
shortcuts or otherwise create long-term links to contacts. This URI
should always be followed by a "/" and the contact's LOOKUP_KEY. It
can optionally also have a "/" and last known contact ID appended
after that. This "complete" format is an important optimization and is
highly recommended.
As long as the contact's row ID remains the same, this URI is
equivalent to CONTENT_URI. If the contact's row ID changes as a result
of a sync or aggregation, this URI will look up the contact using
indirect information (sync IDs or constituent raw contacts).
Lookup key should be appended unencoded - it is stored in the encoded
form, ready for use in a URI.
From getLookupUri(long contactId, String lookupKey)
Build a CONTENT_LOOKUP_URI lookup Uri using the given _ID and
LOOKUP_KEY.
From LOOKUP_KEY
An opaque value that contains hints on how to find the contact if its
row id changed as a result of a sync or aggregation.