Search code examples
javaandroideventsandroid-intentlistener

How do I listen/catch success events of social media sharing using Android Share Intent Chooser (ACTION_SEND)?


I am using Intent ACTION_SEND to share a content in different social media. enter image description here

Now, disregarding other apps in there leaving twitter, facebook, instagram, How will I know if the shares have been successfully posted? Is there some kind of listener for it? Or are there intent for result features for it? Here's the Intent code

public static void shareTo(String type, String mediaPath, String caption, Context context) {


    Intent share = new Intent(Intent.ACTION_SEND);


    share.setType(type);


    File media = new File(mediaPath);
    Uri uri = Uri.fromFile(media);


    share.putExtra(Intent.EXTRA_STREAM, uri);
    share.putExtra(Intent.EXTRA_TEXT, caption);


    context.startActivity(Intent.createChooser(share, "Share to"));
}

Solution

  • No, sorry. You don't get any feedback on what the recipient of an ACTION_SEND intent does with it.