我正在尝试发送带有 jpg 附件的电子邮件意图。
I did:
Intent intent4 = new Intent(Intent.ACTION_SENDTO,
Uri.fromParts("mailto", "[email protected] /cdn-cgi/l/email-protection", 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", "[email protected] /cdn-cgi/l/email-protection", null));
intent4.setDataAndType(Uri.parse("file://"+ mTempFilePath),
Bitmap.CompressFormat.JPEG.name());
startActivity(intent4);
您是否尝试手动将 mime 设置为"image/jpeg"
代替Bitmap.CompressFormat.JPEG.name()
.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)