title: How to attach multiple images to an email?
body: <p>I am trying to attach multiple images to an email.</p>
  
  <p>I have tried the next code, but I don`t know what I am doing wrong.</p>
  
  <p>I need to call the images by the Integer Array that you will see and attach them to an email.</p>
  
  <p>Some of the class look like this:</p>
  
  <pre><code>Integer[] images = {
          R.drawable.image1,
          R.drawable.image2,
          R.drawable.image3,
          R.drawable.image4 };
  
  @Override
  public void onClick(View v) {
      // TODO Auto-generated method stub
      switch(v.getId()){
  
      case R.id.bSendEmail:
  
          Intent emailintent2 = new Intent(android.content.Intent.ACTION_SEND_MULTIPLE);
          emailintent2.setType("plain/text");
          emailintent2.putExtra(Intent.EXTRA_EMAIL, emailaddress2);
          emailintent2.putExtra(Intent.EXTRA_SUBJECT, corsub);
          emailintent2.putExtra(Intent.EXTRA_TEXT, message2);
  
          ArrayList&lt;Uri&gt; uris = new ArrayList&lt;Uri&gt;();
  
          uris.add(Uri.parse("android.resource://" + getPackageName() + "/" + images[0]));
          uris.add(Uri.parse("android.resource://" + getPackageName() + "/" + images[1]));
          uris.add(Uri.parse("android.resource://" + getPackageName() + "/" + images[2]));
          uris.add(Uri.parse("android.resource://" + getPackageName() + "/" + images[3]));
  
          emailintent2.putExtra(Intent.EXTRA_STREAM, uris);
          startActivity(emailintent2);
  
       break;
  </code></pre>