In my application, when the user clicks the button, I want to open the contacts application and display certain contact information.
At that moment I have this:
Intent intent = new Intent(Intent.ACTION_VIEW, People.CONTENT_URI);
startActivity(intent);
Displays a contact application with all displayed contacts.
But how do I get it to display only one contact in accordance with the name or number of contacts?
This code works: (answer)
Uri contactUri = ContentUris.withAppendedId(People.CONTENT_URI, 23);
Intent intent = new Intent(Intent.ACTION_VIEW, contactUri);
startActivity(intent);
source
share