cherif cherif - 1 year ago 74
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?


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