i have a question about Webview.
It`s my source and result.
private void saveDocumentImage() {
WebView wv = arrWebView.get(0);
wv.measure(MeasureSpec.makeMeasureSpec(MeasureSpec.UNSPECIFIED, MeasureSpec.UNSPECIFIED), MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));
int y=wv.getHeight();
Bitmap captureView = Bitmap.createBitmap(wv.getMeasuredWidth(), wv.getMeasuredHeight(), Bitmap.Config.ARGB_8888);
wv.layout(0, 0, wv.getMeasuredWidth(), wv.getMeasuredHeight());
Canvas screenShotCanvas = new Canvas(captureView);
wv.draw(screenShotCanvas);
if (captureView != null) {
try {
String path = Environment.getExternalStorageDirectory().toString();
OutputStream fOut = null;
File file = new File(path, "temp");
if (!file.exists())
file.mkdirs();
fOut = new FileOutputStream(path + "/temp/test_0.jpg");
captureView.compress(Bitmap.CompressFormat.JPEG, 100, fOut);
wv.setDrawingCacheEnabled(false);
} catch (FileNotFoundException e) {
e.printStackTrace();
}
}
wv.destroyDrawingCache();
captureView.recycle();
captureView=null;
}
and here is same as mine. : https://stackoverflow.com/questions/37023619/capturing-bitmap-android-chromium-webview-returns-content-as-white