Mridang Agarwalla
Mridang Agarwalla

Reputation: 44998

How can I open the user's profile contact using an Intent?

I'd like to build an intent which opens the user's profile contact in the "Contacts" application. I've read that the profile/me contact is always at position 0 but it doesn't work with the snippet I've built:

new Intent(Intent.ACTION_VIEW).setData(Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_URI, "0"))

Could any of you tell me how I can resolve this?

Upvotes: 1

Views: 165

Answers (2)

Mridang Agarwalla
Mridang Agarwalla

Reputation: 44998

Looking at the source of the QuickSettings.java Profile tile, I got this to work:

new Intent(Intent.ACTION_VIEW).setData(ContactsContract.Profile.CONTENT_URI)

Upvotes: 0

yushulx
yushulx

Reputation: 12150

try to use ContactsContract.Profile.CONTENT_URI instead.

Upvotes: 1

Related Questions