I want to take a screenshot of a web view after the page loading finished. So I try to add the getSnapShot()
in onPageFinished()
, but when call the getSnapShot()
, the page is not loaded. So the picture of snapshot is blank.
And I load a local html file url, so I believe there is no redirect.
I also tried to make MyWebView extends WebView
, override onDraw()
, add a callback listener to call getSnapShot()
at onDraw()
process. But still not working.
webView.setWebViewClient(new WebViewClient() {
@Override
public void onPageFinished(WebView view, String url) {
super.onPageFinished(view, url);
// will get a blank picture
getSnapshot();
}
});