0

I have an app that can share some plain text via Fb, Twitter or other apps. I'd like to get triggered if user really shared my content or just canceled(or failed) share process.

I tried to start activity for result but since Intent.ACTION_SEND doesn't return any result I get resultCode = RESULT_CANCELED as explained here, any tricks are appreciated.

  Intent shareIntent = new Intent(Intent.ACTION_SEND);
  shareIntent.setType("text/plain");
  shareIntent.putExtra(Intent.EXTRA_TEXT, "my text);
  startActivityForResult(shareIntent,123);
Choletski
  • 7,074
  • 6
  • 43
  • 64

2 Answers2

1

It is not possible if you are sharing via Intent but if you are using SDK of facebook or twitter you can detect that..

for Facebook Share read this documentation here is call back of sharing! & for Twitter use this link.

The above methods are with native SDK's.

Intsab Haider
  • 3,491
  • 3
  • 23
  • 32
0

It's not possibile.

Even if the Intent is not explicit (doesn't target a specific Activity but let Android to display you a Chooser in which you can choose i which App do the "Share" action) your App will receive some event only if the user chooses YOUR APP in that prompted Chooser window.

Only creating an Xposed Framework module it's possibile to do it. But it's difficult...

emandt
  • 2,547
  • 2
  • 16
  • 20