I have something like the following code:
public void shareImageInEmail(String imageUri){
Intent emailIntent = new Intent(Intent.ACTION_SEND);
emailIntent.setType("message/rfc822");
emailIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
emailIntent.putExtra(Intent.EXTRA_TEXT, "Some text");
emailIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(imageUri));
mActivity.startActivity(emailIntent);
}
When the Uri
is grabbed from the media folders (camera albums, etc) everything works fine.
The problem is when I take a Uri
from the assets folder like this:
share("content://com.ex.myapp/logo.png");
In that case, the sharing works but when the e-mail client is opened, the image preview is a grey box, instead of the actual image. When I send the picture is sent correctly, it's just not showing the preview.
Anyone have a solution for this?