cherif cherif - 2 years ago 119
Android Question

Android direct shared

I am trying to share a link from my app with direct share. The share dialog must be like the image below with the most used contacts from messaging apps, like Whatsapp contacts.

Goal which I am trying to achieve

This is the

structure which I am using for share the link:

Intent shareIntent = ShareCompat.IntentBuilder
.setText(sTitle+ "\n" + urlPost)
if (shareIntent.resolveActivity(
getActivity().getPackageManager()) != null)

And this is what my app shows:

what my app shows

Any idea how to achieve that?

Answer Source

You should use .createChooserIntent() instead of .getIntent()

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download