Ich habe den folgenden Code, um Details eines Kontakts zu erhalten. "Daten": ist der URI, den ich nach Auswahl des Kontaktes zurückbekomme.LOOKUP_KEY und CONTENT_LOOKUP_URI
Ich muss sicher sein, dass ich in Zukunft den richtigen Kontakt bekomme, also was sollte ich für zukünftige Verwendung sparen? Ist es "LookupUri" oder "LookupKey"?
Cursor c = activity.managedQuery(data, null, null, null, null);
c.moveToFirst();
String lookupKey = c.getString(c.getColumnIndex(ContactsContract.Contacts.LOOKUP_KEY));
c.close();
// Next use that key to access the details of the contact in order to get the name and the photo
// Also, save it for future use.
// It will be used when we fetch the details from the database since the photo itself is not saved.
Uri lookupUri = Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_LOOKUP_URI,lookupKey);
Uri uri = ContactsContract.Contacts.lookupContact(activity.getContentResolver(), deviceDetails.lookupUri);