We are using Google Analytics to track what features of our application are being used and how, but this question could also apply to any situation where you want to know what a user did after calling the ACTION_SEND Intent.
Basically, I want to use this functionality to allow users to share content (Email, Twitter, Facebook, etc.) This works wonderfully using the stock Android Intent functionality, allowing the user to pick their preferred email client, twitter app, ect.
Intent sharingIntent = new Intent(Intent.ACTION_SEND);
//Text seems to be necessary for Facebook and Twitter
sharingIntent.setType("text/plain");
sharingIntent.putExtra(Intent.EXTRA_TEXT, "whatever I want to share");
startActivity(Intent.createChooser(sharingIntent,"Share using"));
However, I can't find any way to know what the user did upon return from the Intent. I looked into using startActivityForResult
instead, but this seems to only return whether or not they completed or canceled sharing (and even that seems inconsistently implemented across different applications) - it certainly doesn't give me any information on what they did.
At this point, it looks like in order to have my analytics, I would have to implement sharing via Facebook and Twitter using custom actions of my own and their respective SDKs?
This seems a shame since it undermines one of the nice features of Android - being able to use your preferred Email, Twitter, Facebook and Browser applications....
How about reading from the Android logs? I expect the logs contain details of what they selected. Ugly, but it might work.