I have an app that takes a screenshot and the shares this with the share intent. Rather than save multiple images each time a user wants to simply share the image. Below is the code I used for images saved to the SD
Intent share = new Intent(Intent.ACTION_SEND);
share.setType("image/png");
dir = "file://" + Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + "Folder/" + location;
share.putExtra(Intent.EXTRA_STREAM, Uri.parse(dir));
startActivity(Intent.createChooser(share, "Share Image"));
However I cant figure out how to simply save a Bitmap such as...
share.putExtra(Intent.EXTRA_STREAM, theBitmap);
Is there a way to do this without saving the image?
Thanks
In fact sharing an image without saving it is by using cache memory. Consequently we can share it like an uri. On the other hand we can simply store the image in cache and use the uri for sharing. Furthermore we are saving bitmap to cache and use it for sharing.
What I eneded up doing was saving one "Temp" image to the SD/Phone and just overwrite the each time.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With