Reputation: 444
I'm trying to send a chart via email in android application, how can I attach that chart to email application?
Upvotes: 1
Views: 3174
Reputation:
Before attaching the graph to email we have to save the graph image into storage, For that you just enable the cache for that view by setting setDrawingCacheEnabled(true);
Then create the bitmap Bitmap.createBitmap(View.getDrawingCache());
.
we can convert the bitmap to desired image format as follows
bitmap.compress(CompressFormat.PNG, 100, new FileOutputStream(filename));
Upvotes: 3