[英]Adding a file as an attachment to gmail
當我添加文件作為附件到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"));
我想要包含這些文件:)
好的,我有安裝。
fileIn.setReadable(true,false)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.