Amanni Amanni - 1 year ago 501
Android Question

share image with URL android share intent

I need to know if it is possible to share an image using only its url with a share intent. Here is my code.

Intent imageIntent = new Intent(Intent.ACTION_SEND);
Uri imageUri = Uri.parse("");
imageIntent.putExtra(Intent.EXTRA_STREAM, imageUri);

So far its not working and I haven't found any helpful answers online. I would like to do this using the share intent and without downloading the image.

Answer Source

You can share image using share intent, but you've to decode image to a localized Bitmap

Intent intent = new Intent(Intent.ACTION_SEND);
intent.putExtra(Intent.EXTRA_TEXT, "Hey view/download this image");
String path = Images.Media.insertImage(getContentResolver(), loadedImage, "", null);
Uri screenshotUri = Uri.parse(path);

intent.putExtra(Intent.EXTRA_STREAM, screenshotUri);
startActivity(Intent.createChooser(intent, "Share image via..."));

loadedImage is the loaded bitmap from