Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Share Intent - Getting results, where it got shared and status?

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:"));
like image 817
basitj Avatar asked Nov 01 '13 05:11

basitj


1 Answers

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!

like image 106
Song Keang Avatar answered Oct 19 '22 12:10

Song Keang