How to insert photo in call intent?

2019-08-06 03:06发布

问题:

If I use the Android Phone app to call, the app shows a photo from the contact that I am calling.

But, if I use an intent to call the Phone app (below code), there is no photo.

Intent callIntent = new Intent(Intent.ACTION_CALL);
callIntent.setData(Uri.parse("tel:1234567890"));
startActivity(callIntent);

How do I show the contact's photo when calling?

Thanks!

回答1:

http://developer.android.com/reference/android/content/Intent.html#ACTION_DIAL

I'm assuming you need to pass the Uri of a phone number, and not an explicit phone number.

ACTION_DIAL content://contacts/people/1 -- Display the phone dialer with the person filled in.