我正在尝试使用附加的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);