I created an app with action click to send email with image attachment file, I was think the code is working right, after I found the image size of attachment is 0kb, and when I clicked it, it said "Unable find the item", here is the code I use for
public void SendEmailWithAttachment(final String imageUrl){
String path = "file:///android_asset".concat(File.separator).concat(getString(R.string.sa_books_directory)).concat(File.separator); // Get the path file from my asset folder
Intent emailIntent = new Intent(Intent.ACTION_SEND);
emailIntent.setType("image/jpeg");
emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, "");
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "This is subject");
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, "This is email body");
emailIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(path + "IndividualVillas/pages/" + imageUrl + ".jpg"));
startActivity(emailIntent);
}
I don't know where is the problem, I had tried to change the setType but it doesn't help me also. Any kind help will much appreciate :)
Sorry for my bad English