How to convert an activity to an image
2 answers
You can programmatically take a screenshot of your device, which should do the trick. Take a look at this SO answer> it should get you started.
+2
source to share
You can map different views of your application to Bitmap
Objects by capturing drawing cache
.
just refer to http://blog.neurolive.net/2010/11/385/ for more details. (thanks, for a great tutorial)
special
private Bitmap getScreenViewBitmap(View v) {
v.setDrawingCacheEnabled(true);
// this is the important code :)
// Without it the view will have a dimension of 0,0 and the bitmap will be null
v.measure(MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED),
MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));
v.layout(0, 0, v.getMeasuredWidth(), v.getMeasuredHeight());
v.buildDrawingCache(true);
Bitmap b = Bitmap.createBitmap(v.getDrawingCache());
v.setDrawingCacheEnabled(false); // clear drawing cache
}
it seems that you are interested. (Just find your top level view and use this method to capture Bitmap)
0
source to share