【发布时间】:2019-03-29 12:35:50
【问题描述】:
当我将文件作为附件添加到 gmail 时,我看不到我的文件,只有消息“其中一个文件的大小超过 20mb”,但我检查了,我必须将文件 json 和图像,json 的大小小于 1kb并且图像的大小小于 600kB。
我检查过,我没有机会压缩更多文件,也看不出我需要这样做的原因。
Intent sharingIntent = new Intent(Intent.ACTION_SEND_MULTIPLE);
sharingIntent.setType("vnd.android.cursor.dir/email");
Uri jsonPath = Uri.fromFile(json);
Uri screenshotPath = Uri.fromFile(image);
ArrayList<Uri> uris = new ArrayList<>();
uris.add(json);
uris.add(image);
StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder();
StrictMode.setVmPolicy(builder.build());
sharingIntent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, uris);
sharingIntent.putExtra(Intent.EXTRA_SUBJECT, "Please entry the subject");
sharingIntent.putExtra(Intent.EXTRA_TEXT, "Please entry the content of email");
startActivity(Intent.createChooser(sharingIntent, "Choose direct application"));
我想包含这些文件 :)
【问题讨论】:
-
我必须添加我尝试在 android 6.0 上执行此操作的信息
标签: android gmail size add email-attachments