Multiple mail attachment - PhoneGap

后端 未结 2 1536
鱼传尺愫
鱼传尺愫 2021-01-27 14:16

Hi i am doing an app in phonegap which need to have multiple attachment but i am unable to have multiple attachment. Any solution for this. My code are as below:



        
2条回答
  •  我在风中等你
    2021-01-27 14:29

    The error is in the line

    emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, Html.fromHtml(body));
    

    The problem is that HTML.fromHtml(body) returns a android.text.SpannableStringBuilder which cannot be casted to java.util.ArrayList. Try to replace that line of code with

    emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, Html.fromHtml(body).toString());
    

    or with

    ArrayList list = new ArrayList();
    list.add(Html.fromHtml(body).toString());
    emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, list);
    

提交回复
热议问题