title: How to open locally saved PDF file in an Android WebView?
body: <p>I have tried to open a locally saved PDF file in a WebView. I can open it by using IntentService, but I want to open it in a WebView. Except for PDFs, all other files are working for me.</p>
  
  <p>I have used the codes below:</p>
  
  <pre><code>WebSettings settings = webView.getSettings();
  settings.setJavaScriptEnabled(true);
  settings.setBuiltInZoomControls(true);
  settings.setSupportZoom(true);
  settings.setAllowFileAccess(true);
  String mimeType = MimeTypeMap.getSingleton().getMimeTypeFromExtension(MimeTypeMap.getFileExtensionFromUrl(mFilePath));
  webView.loadData(mFilePath, mimeType, "UTF-8");
  </code></pre>
  
  <p>Can anyone please help? Thanks in advance.</p>