【发布时间】:2020-07-11 20:10:39
【问题描述】:
问题是,如何在不压缩和质量损失的情况下将大图像(例如 720 * 8549)发送到 WhatsApp。 可以这样做吗?
以下是发送我使用的图像的代码:
Intent shareIntent = new Intent();
shareIntent.setAction(Intent.ACTION_SEND);
shareIntent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
File photoFile = new File(imageFile.getParent(), imageFile.getName());
Uri photoURI = FileProvider.getUriForFile(getBaseContext(), getApplicationContext().getPackageName(),
photoFile);
shareIntent.putExtra(Intent.EXTRA_STREAM,photoURI);
shareIntent.setType("image/*");
startActivity(Intent.createChooser(shareIntent, getBaseContext().getString(R.string.photo_share)));
所以我发送了一个压缩且不可读的图像。 也许有人遇到过类似的情况。
祝大家好运!
【问题讨论】:
标签: java android send whatsapp