I trying to create a "publish" button for an image in my android app, that works with the Facebook App and Email.
This is my code (imagePath is something like "/sdcard/myapp/image.jpg"
Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.setType("image/jpeg");
sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("file://"+imagePath));
sendIntent.putExtra(Intent.EXTRA_TEXT, "Enjoy the photo");
startActivity(Intent.createChooser(sendIntent, "Email:"));
This works perfectly for sending the email with the attachment, but it doesn't work with the Facebook App. If I'm using
sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(imagePath));
the publishing for Facebook works - but the email-attachment isn't send anymore.
Any ideas what could do it for both?