I have PDF as an byte array.How to pass byte[]
to WebView to display on the screen?
I tried to do it:
byte[] pdfByteArray = getPDFFromServer();
if (pdfByteArray != null && pdfByteArray.length != 0) {
String base64 = Base64.encodeToString(pdfByteArray, Base64.DEFAULT);
webView.loadData(base64, "text/html","UTF-8");
}
but it does't work.
Many thanks in advance!