How can i tell if a user successfully completed a share intent? For instance if a user wanted to share an app via Facebook or Twitter.
Edit:
I am not looking at how to create an Intent
for sharing. I want to know if the user actually shared anything. Or did the user hit the cancel button.
For twitter - the "data" object in OnActivityResult is null when the user cancels the share.
You have use the
Intent.ACTION_SEND
, and the system will display a list of applications (on the device) where you can share. This website explains how:http://sudarmuthu.com/blog/sharing-content-in-android-using-action_send-intent
I don't think there is an assured way to do it.
You could initiate the send using
startActivityForResult()
and hope that the activity which handles the Intent replies with aRESULT_OK
. But you can't rely on it to work always.