You can tell Android to show a specified contact for the user simply by sending an Intent with the contact’s Id, then will one or more ContentResolvers recognise the format and be choosable by user.
1 2 3 4 5 6 7 8 |
public static final void showContact(Context ctx, String contactId) { if (contactId != null) { Intent intent = new Intent(Intent.ACTION_VIEW); Uri uri = Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_URI, contactId); intent.setData(uri); ctx.startActivity(intent); } } |