I'm trying to load a webview with some html code and then capture it and turn into a Bitmap. However, all I can see in the ImageView I set to test it, is a blank square.
webViewToPrint.loadDataWithBaseURL("", dataStringHtml , "text/html", "UTF-8", "");
webViewToPrint.setWebViewClient(new WebViewClient() {
@Override
public void onPageFinished(WebView view, String url) {
super.onPageFinished(view, url);
Bitmap b = Bitmap.createBitmap( view.getHeight(), view.getWidth(), Config.ARGB_8888);
Canvas canvas = new Canvas( b );
view.draw(canvas);
imageView.setImageBitmap(b);
}});