【问题标题】:How to view PDF File From the drive如何从驱动器中查看 PDF 文件
【发布时间】:2018-12-28 10:59:15
【问题描述】:

我的谷歌驱动器帐户中有一些 PDF 文件,所以我如何使用 Intent 或 webview 在 android studio 中查看这些 pdf 文件。我怎么能做到这一点。

 public String co="https://drive.google.com/file/d/1kr3y_2EI8-uyDeMI5DpMFLnMQDVqI-3Z/view?usp=sharing"
 webview.loadURL(co);

此代码不起作用。

【问题讨论】:

标签: android


【解决方案1】:

我想你不见了 webView.getSettings().setJavaScriptEnabled(true);

    public String co="https://drive.google.com/file/d/1kr3y_2EI8-uyDeMI5DpMFLnMQDVqI3Z/view?usp=sharing"
     webView.getSettings().setJavaScriptEnabled(true);
     webview.loadURL(co);

或者你可以使用:

Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(https://drive.google.com/file/d/1kr3y_2EI8-uyDeMI5DpMFLnMQDVqI3Z/view?usp=sharing));
startActivity(browserIntent);

还要确保网址有效。

【讨论】:

    猜你喜欢
    • 2022-01-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-12-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多