我的应用程序成功发送电子邮件,但是当我尝试附加图像时,代码崩溃是代码片段
Intent i = new Intent(Intent.ACTION_SEND);
i.setType("message/rfc822");
i.putExtra(Intent.EXTRA_EMAIL , new String[]{"email address"});
i.putExtra(Intent.EXTRA_SUBJECT, "subject of email");
i.putExtra(Intent.EXTRA_TEXT , "body of email");
// i.putExtra(Intent.EXTRA_STREAM, R.drawable.pic4);
try {
startActivity(Intent.createChooser(i, "Send mail..."));
} catch (android.content.ActivityNotFoundException ex) {
Toast.makeText(EidCards.this, "There are no email clients installed.", Toast.LENGTH_SHORT).show();
}
被注释的行使代码崩溃,请提出出路!