title: Android - attaching multiple files in email intent crashes Gmail
body: <p>I try to attach multiple files in an E-mail intent this way (which i saw in an accepted answer in stackoverflow):</p>
  
  <pre><code>String[] attachments;&lt;--contains all the filenames i want to attach;
  ArrayList&lt;Uri&gt; uris = new ArrayList&lt;Uri&gt;();
  
  for (String file : attachments){
      if(!file.equals("")){
          Log.w("-"+file +"-","attached");
          File fileIn = new File(file);
          Uri u = Uri.fromFile(fileIn);
          uris.add(u);
      }
  }
  //check that uri list is correct
  for(Uri uri1:uris){
      Log.w(uri1.toString(),"uri list");
  }
  
  intMail.putParcelableArrayListExtra(Intent.EXTRA_STREAM, uris);
  </code></pre>
  
  <p>This code causes Gmail client to crash and the logcat says as a warning:</p>
  
  <pre><code>Key android.intent.extra.STREAM expected Parcelable but value was a java.util.ArrayList.The default value &lt;null&gt; was returned.
  </code></pre>
  
  <p>After that Gmal crashes and logcat says</p>
  
  <pre><code>E/AndroidRuntime(10355): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.google.android.gm/com.google.android.gm.ComposeActivity}: java.lang.NullPointerException
  </code></pre>
  
  <p>I don't get what i am doing wrong....Any useful advice/input?</p>