http://stackoverflow.com/questions/10788252/best-practice-adding-your-app-to-the-android-share-menu

Intent intent = getIntent();
if (Intent.ACTION_SEND.equals(intent.getAction()))
{
 Uri uri = (Uri) intent.getParcelableExtra(Intent.EXTRA_STREAM);
 if (uri != null) {
    fileset = new HashSet();
    fileset.add(getPathfromUri(uri));
     }
 }