Zhen Liu
Zhen Liu

Reputation: 7922

display contact with given display name android

SO,how do i do it? I have tried the following

Intent intent = new Intent(ContactsContract.Intents.SHOW_OR_CREATE_CONTACT);
intent.setData(Uri.fromParts("mailto","[email protected]", null));
context.startActivity(intent);

The above works only with mailto or tel, what about name?

Upvotes: 0

Views: 328

Answers (1)

ρяσѕρєя K
ρяσѕρєя K

Reputation: 132972

you can also send Person Name using Intents.Insert.NAME with Intent as:

Intent intent = new Intent(ContactsContract.Intents.SHOW_OR_CREATE_CONTACT);
intent.setData(Uri.fromParts("mailto","[email protected]", null));
// add name here
intent.putExtra(Intents.Insert.NAME, sender_Name_here); 
context.startActivity(intent);

Upvotes: 2

Related Questions