title: How to share an image from the Internet without saving it?
body: <p>I'm trying to share an image from the internet using share intents. This doesn't work because I think the image needs to be downloaded first: </p>
  
  <pre><code>intent.putExtra(Intent.EXTRA_STREAM, imageUri);
  </code></pre>
  
  <p>So I'm downloading an image and then sharing it:</p>
  
  <pre><code>@Background
  protected void tryToShareImage(Intent intent) {
      try {
          URL url = new URL(mImageUrl);
          Bitmap image = BitmapFactory.decodeStream(url.openConnection().getInputStream());
          intent.putExtra(Intent.EXTRA_STREAM, getImageUri(mActivity, image));
      } catch (Exception e) {
          e.printStackTrace();
      }
      startActivity(Intent.createChooser(intent, "Share using..."));
  }
  
  public Uri getImageUri(Context inContext, Bitmap inImage) {
      ByteArrayOutputStream bytes = new ByteArrayOutputStream();
      inImage.compress(Bitmap.CompressFormat.JPEG, 100, bytes);
      String path = MediaStore.Images.Media.insertImage(inContext.getContentResolver(), inImage, "Title", null);
      return Uri.parse(path);
  }
  </code></pre>
  
  <p>However, there's one problem: the image stays in the gallery after I don't need it anymore. </p>
  
  <p>Question: Is there a way to share an image from the Internet without saving it first? </p>