Issue
In my layout I am using a WebView in which I am loading a url, which has a map & some animating objects. I want to capture the bitmap of the layout. For that I am using following method.
Bitmap bitmap = view.getDrawingCache();
I also tried other method for capturing bitmap.
public Bitmap screenShot(View view) {
Bitmap bitmap = Bitmap.createBitmap(view.getWidth(),
view.getHeight(), Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(bitmap);
view.draw(canvas);
return bitmap;
}
But after capturing the bitmap I get everything except animating objects. I also tried with static map as well where the objects are not moving but still I get the same result. But when I take the screenshot from device (by pressing Vol- & Power) then it captures everything.
I am really not sure what is the issue.
First image is the WebView where it loads the url with map, pins & path.
Second is what it captured using methods mentioned above.
Solution
All I had to do is to set the android:hardwareAccelerated="false"
in the Manifest file for my Activity.
Answered By - Arun Badole
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.