I am generating pie chart on image view, I want to send it via email.
How to convert image view's image to email attachment, as its not available in resources?
I am generating pie chart on image view, I want to send it via email.
How to convert image view's image to email attachment, as its not available in resources?
It sounds to me like a lot of extra work is going on here. If you have the ImageView available at run-time, we'll call it mImageView, then you could do something like this:
Now you have a Bitmap image that you can append to an email as an attachment. I haven't prototyped it to make 100% sure this will do exactly what you're looking for, but it seems a lot more elegant than saving it to the SD card just so you can stream it back to a Bitmap and attach it to an email.
Let me know if that doesn't work and I'll try to prototype out something
Thanks, David
The easiest and most Android-friendly way would be to use the ACTION_SEND Intent. The code would look something like this:
Call
getDrawingCache()
on your image view. This returns the cache bitmap of the view. Read documentation here.Save the bitmap as PNG, create a mail and attach and send.