title: How to open local PDF file in WebView in Android?
body: <p>I want to open local (SD card) PDF file in a WebView.</p>
  
  <p>I already tried this:</p>
  
  <pre><code>webview = (WebView) findViewById(R.id.webview);
  webview.getSettings().setJavaScriptEnabled(true);
  webview.getSettings().setPluginsEnabled(true);
  webview.getSettings().setAllowFileAccess(true);
  File file = new File(Environment.getExternalStorageDirectory() + "/test.pdf");
  
  final Uri uri = Uri.fromFile(file);
  
  webview.loadUrl(uri.toString());
  </code></pre>
  
  <p>But it's still not opening it, so let me know how I can open a PDF in WebView?</p>