通过共享意图环聊共享图像时,在 android 的图像预览屏幕中显示旧图像

while sharing image via share intent hangout shows old image inside image preview screen in android

通过 android 分享图片时,share intent hangout 会在发送图片前出现的图片预览屏幕中显示旧图片,但 whatsapp 和 facebook 会显示当前选择的图片本身,

即使点击发送后在预览中显示错误的图片,在聊天中也只会显示正确的图片。

 Intent intent = new Intent(Intent.ACTION_SEND);
            intent.setType("image/png");
            intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
            intent.putExtra(Intent.EXTRA_STREAM, uri);
            intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
            startActivity(Intent.createChooser(intent, "Share news via.."));

任何人都可以帮助解决这个问题

我找到了这个问题背后的原因,我每次都给相同的名称来存储和共享图像,默认情况下环聊图像发送预览屏幕将显示旧图像,如果图像名称相同。所以每次更改图像名称都会解决问题。