Como abrir arquivo PDF local no WebView no Android?

Desejo abrir o arquivo PDF local (cartão SD) em um WebView.

Eu já tentei isso:

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());

Mas ainda não está abrindo, então deixe-me saber como posso abrir um PDF no WebView?

questionAnswers(6)

yourAnswerToTheQuestion