String exactname = "Joe Blogs"
I’ve searched high and low of a way to directly open the contact using DISPLAY_NAME not the _ID of the contact.
EDIT: Joe Blogs is definitely a unique entry.
From this answer
Intent intent = new Intent(Intent.ACTION_VIEW);
Uri uri = Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_URI, String.valueOf(contactID));
intent.setData(uri);
context.startActivity(intent);
Do I have to query the ID of Joe Blogs before I can open his contact with an intent similar to the above? Or have I (hopefully) missed something?
Thanks in advance.
Yes, you need to query your database with something like,
Then retrieve the row returned by the
Cursorwith,This will return the contact id associated with the first record in the
Cursor.