【发布时间】:2009-06-29 20:02:35
【问题描述】:
我正在尝试使用附加的 jpg 启动电子邮件意图。
我做到了:
Intent intent4 = new Intent(Intent.ACTION_SENDTO,
Uri.fromParts("mailto", "testemail@gmail.com", null));
startActivity(intent4);
这会启动电子邮件活动。
但是当我尝试添加 DataAndType(我的 jpeg 附件)时。它失败了
android.content.ActivityNotFoundException: No Activity found to handle Intent { action=android.intent.action.SENDTO data=file:///data/data/com.mycompany.mypackage/files/temp-picture type=JPEG
Intent intent4 = new Intent(Intent.ACTION_SENDTO,
Uri.fromParts("mailto", "testemail@gmail.com", null));
intent4.setDataAndType(Uri.parse("file://"+ mTempFilePath),
Bitmap.CompressFormat.JPEG.name());
startActivity(intent4);
【问题讨论】: