10

In my Android app, I'm using following code to share a photo with any app that can share it. So depending on what app is installed it can be shared with gmail, facebook, twitter and so on.

Here are my questions:

  1. Can I get a result from Intent that tells where was this image shared?
  2. Can I get the status of the upload of this share?
  3. Can I at least know when the share dialog disappears and I get the focus back onto my app?
Intent shareIntent = new Intent();
shareIntent.setAction(Intent.ACTION_SEND);
shareIntent.setType("image/png");
Uri uri = Uri.parse("android.resource://com.mypackage.myapp/"+MainScreen.selectedCardId);
shareIntent.putExtra(Intent.EXTRA_STREAM, uri);
shareIntent.putExtra(Intent.EXTRA_TEXT, "Email body text");
startActivity(Intent.createChooser(shareIntent, "Share your card with:"));
tshepang
  • 12,111
  • 21
  • 91
  • 136
basitj
  • 263
  • 3
  • 11

1 Answers1

6

This question may be related to: Successful share intent for android

Basically it depends on the target app, whether they set a result and send back to your app or not. It's quite unreliable at this point from what I understand and I'm looking for a workaround too!

Community
  • 1
  • 1
Song Keang
  • 357
  • 3
  • 7