Using webview the following code will execute fine on online and it will display the PDF file. After that if i goes to offline it will not display the cached pdf file.
mWebview.getSettings().setJavaScriptEnabled(true);
String pdfStr="https://www.sample.structure.first.pdf";
mWebview.loadUrl("https://docs.google.com/gview?embedded=true&url=" + pdfStr);
But i need to cache the pdf and display it on offline mode also. Anybody have any idea about this?
You can save your work in cache of Web view using following:
Add this method to check if network is available:
Add these permissions in your manifest :