-1

I have a file path of images which was taken from the Gallery and I am adding each file path in to ArrayList. Everything works fine and even I could see the attachments in Gmail. But once if I try to send the images. I am getting couldn't send attachments error. Please help me to resolve this issue. I am completely stuck up with the solutions. Thanks in advance.

The path of a image is something like /storage/emulated/0/myfolder/1433917106851_fact_2.jpg

                Intent intent = new Intent();
                intent.setAction(Intent.ACTION_SEND_MULTIPLE);
                intent.putExtra(Intent.EXTRA_SUBJECT, "Here are some files.");
                intent.setType("image/jpeg"); /* This example is sharing jpeg images. */
                intent.putParcelableArrayListExtra (Intent.EXTRA_STREAM, mShareImages);  //<=== This is the arraylist of images path. 
                startActivity(intent);

Note: mShareImages is a ArrayList<Uri>. I am converting ArrayList<String> to ArrayList<Uri> by using

Uri uri = Uri.Parse(string);

Finally adding this uri object into ArrayList by

mShareImages.add(uri);
Chandru
  • 5,954
  • 11
  • 45
  • 85
  • I got this error. It was because the path of one of my file wasn't right, so gmail wasn't able to read/attach the file and showed "Couldn't send attachment". – sonique Jan 19 '16 at 00:02

2 Answers2

0

You should put list of the Uri into intent extras, not list of String

0

mShareImages needs to be a ArrayList of type Uri and not String.

Dominic D'Souza
  • 961
  • 2
  • 7
  • 16