Reputation: 6983
I have a file called card1.jpg stored in the assets folder. When my program runs, it shows a paaper clip in the email and it seems like everything works when I press send. But.... no attachment ever gets sent.
code: case R.id.butEmail: Intent msg = new Intent(Intent.ACTION_SEND); msg.setType("text/plain"); msg.putExtra(Intent.EXTRA_EMAIL, new String[] {"[email protected]"}); msg.putExtra(Intent.EXTRA_TEXT, "attach image"); msg.putExtra(Intent.EXTRA_SUBJECT, "Just Feet");
String rawFolderPath = "file://android_assets//card1.jpg";
Uri emailUri = Uri.parse(rawFolderPath );
msg.putExtra(Intent.EXTRA_STREAM, emailUri);
msg.setType("application/jpg");
startActivity(Intent.createChooser(msg, "Emailinng..."));
break;
Upvotes: 0
Views: 110
Reputation: 6033
Two points:
file:///android_assets/folder1/folder2/image.png"
Upvotes: 0