0

How can i share a image from url to whatsapp using share intent. How can i convert the URL to bitmap and then share it.

That's my code:

Intent whatsappIntent = new Intent(Intent.ACTION_SEND);
                    whatsappIntent.setType("image/*");
                    whatsappIntent.setPackage("com.whatsapp");
                    whatsappIntent.putExtra(Intent.EXTRA_STREAM, ???);
                    try {
                        startActivity(whatsappIntent);
                    } catch (android.content.ActivityNotFoundException ex) {
                        Toast.makeText(getActivity(), "Whatsapp is not installed on this device", Toast.LENGTH_SHORT).show();
                    }
user9658973
  • 3
  • 1
  • 5
  • No, i want to share images from URL. – user9658973 May 03 '18 at 17:50
  • 1
    Step #1: Download the image, using your favorite HTTP client API. Step #2: Share the downloaded image (e.g., use `FileProvider`). – CommonsWare May 03 '18 at 17:51
  • Possible duplicate of [How to use "Share image using" sharing Intent to share images in android?](https://stackoverflow.com/questions/7661875/how-to-use-share-image-using-sharing-intent-to-share-images-in-android) – Reaz Murshed May 03 '18 at 17:55

0 Answers0