0

I am doing sharing in my application using ShareActionProvider. However I can not find a way to validate if sharing was successful or not (failed, user cancelled it at some point, etc.). Is it possible to do this?

I know I could make it easy using startActivityForResult but I found out that using ShareActionProvider is a recommended way.

mkorszun
  • 4,461
  • 6
  • 28
  • 43
  • just use https://developer.android.com/reference/android/support/v7/widget/ShareActionProvider.html#setOnShareTargetSelectedListener(android.support.v7.widget.ShareActionProvider.OnShareTargetSelectedListener) (setOnShareTargetSelectedListener) – njzk2 May 12 '14 at 21:17
  • according to documentation it is called upon share method selection - not when content was really shared using chosen method. – mkorszun May 12 '14 at 21:21

1 Answers1

1

Is it possible to do this?

No.

I know I could make it easy using startActivityForResult

Usually, that will not work either. That will only work for activities specifically designed to be called by startActivityForResult(), and few ACTION_SEND-capable activities are designed that way. The documentation for ACTION_SEND says that there is no output, and therefore few ACTION_SEND-capable activities will bother calling setResult().

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491