开发者

Is there a limitation on number of email attachments that can be added programmatically?

I'm attempting to programmatically create an email with, potentially, multiple attachments but have run into some difficulty. I consulted this similar question and found that the answer was do create something like this:

ArrayList<Uri> uris = new ArrayList<Uri>();
for (String file : filePaths)
{
    File fileIn = new File(file);
    Uri u = Uri.fromFile(fileIn);
    uris.add(u);
}
emailIntent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, uris);
context.startActivity(Intent.createChooser(emailIntent, "Send mail..."));

This solution seemed to yield mixed results for people, some claiming that it always worked for them and some, including me, getting an exception like this: ClassCastException... putParcelableArrayListExtra requires a parcelable not an ArrayList.

Does anyone know if this is a limitation of a particular Android version? I'm using 1.6 right now, unfortunately, a开发者_Go百科nd I suspect that might be the source of the problem but I haven't been able to confirm this.

Thanks in advance

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜