I am using ContactsContract API in Android to get the list of contacts. The is working fine.
Now I want that when I click on a name in that list an intent is generated that will open the contact in the android contact manager.
The following code crashes the app:
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(ContactsContract.Contacts.CONTENT_URI + "/" + ContactsContract.Contacts._ID));
kindly help me out here with this intent
This should show the contacts 'card' in the android contact manager
Intent intent = new Intent(Intent.ACTION_VIEW);
Uri uri = Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_URI, String.valueOf(contactID));
intent.setData(uri);
context.startActivity(intent);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With