0
点赞
收藏
分享

微信扫一扫

android 唤起系统分享文件或发送邮件(附件)

耶也夜 2022-07-30 阅读 57


代码如下:

Intent intent = new Intent(Intent.ACTION_SEND);
intent.setData(Uri.parse("mailto:"));
intent.putExtra(Intent.EXTRA_EMAIL, addresses);
intent.putExtra(Intent.EXTRA_SUBJECT, subject);
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(file));
context.startActivity(Intent.createChooser(intent, "分享一下"));


兼容问题参考: https://www.jianshu.com/p/9520161ffb05


举报

相关推荐

0 条评论