I remember I had this exact problem a while ago. I'm not sure what I did to fix this, but my working code looks something like this ...
File root = Environment.getExternalStorageDirectory(); String fileName = "foo.txt"; if (root.canWrite()) { attachment = new File(root, fileName); } email.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(attachment)); startActivity(Intent.createChooser(email, "Send Email"));
I remember that since I used the SD card for storage, it did not send my application if I was still connected to the computer via USB (since it saved the SD card and is busy). As soon as I disconnected the USB connection, everything worked out well.
dfetter88
source share