androidwebviewcapture

How to capture a webview to bitmap in Android?


I have a webview, and I need to scroll down to view all the content. Now, I want to capture the entire of the webview to a bitmap.

I looked for many times. People suggested me use the function capturePicture(). However, this function is deprecated. So, what other methods I can use to do to reach my goal?

Thanks all.


Solution

  • I found out the solution. Take a look of this.

    I used the onDraw to replace the capturePicture functon which is deprecated in API 19. If you have any better solutions, please tell me and I appreciate that. Thanks!

    Which can replace capturePicture function