以编程方式将图像作为文档发送到whatsapp

问题描述 投票:1回答:1

问题是,如何在不压缩和质量下降的情况下将大图像(例如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
1个回答
0
投票

这是不可能的,因为WhatsApp总是减小尺寸。 Google相册也尝试过此操作,但是如果您在通过Google相册发送邮件时选择原始,则最后大小仍会缩小。

为什么不采用其他类似Telegram的应用程序?您在那里有更多选择。最简单的方法是共享到原始链接,例如Google相册或Dropbox。

© www.soinside.com 2019 - 2024. All rights reserved.