我正在尝试将多个图像附加到电子邮件中。
我已经尝试了下一个代码,但我不知道我做错了什么。
我需要通过您将看到的整数数组调用图像并将它们附加到电子邮件中。
一些类看起来像这样:
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<Uri> uris = new ArrayList<Uri>();
        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;