Tag: webviewclient

Android – 在webview中加载PDF

我有这个webview代码,我希望能够在用户点击PDF链接时打开PDF文件。 这是代码,你能告诉我我要把它放在PDF区域吗? 我已经尝试了很多不同的方法,我根本无法查看PDF。 谢谢您的帮助。 webview.setWebViewClient ( new WebViewClient() { public boolean shouldOverrideUrlLoading(WebView view, String url) { // do your handling codes here, which url is the requested url // probably you need to open that url rather than redirect: if (url.startsWith(“tel:”)) { startActivity(new Intent(Intent.ACTION_DIAL, Uri.parse(url))); } else if (url.startsWith(“mailto:”)) { url = url.replaceFirst(“mailto:”, “”); url […]