Code:
MapImage Img = (MapImage) ((Button) v).getTag();
ByteArrayOutputStream Os = new ByteArrayOutputStream();
Img.Bm.compress(CompressFormat.JPEG, 100, Os);
byte[] ImgBytes = null;
try {
Os.flush();
ImgBytes = Os.toByteArray();
Os.close();
} catch (IOException e) {}
Intent i = new Intent(Intent.ACTION_SEND) ;
i.setType("image/jpeg");
i.putExtra(Intent.EXTRA_STREAM, ImgBytes);
MyMv.getContext().startActivity(Intent.createChooser(i,"Send Image To:"));
Most of the examples I saw for sending an image using the chooser dialog are sending from a file or stored content somewhere (putExtra(EXTRA_STREAM, Uri)). Does anyone know the correct way to send when all we have is a Bitmap?