【发布时间】:2017-09-19 09:56:56
【问题描述】:
我想从 url 打开 pdf 文件,所以我使用了这个代码:
Intent browserIntent = new Intent(Intent.ACTION_VIEW);
browserIntent.setDataAndType(Uri.parse(string), "application/pdf");
startActivity(browserIntent);
当协议是http时它工作,但如果协议是https,我得到错误ActivityNotFoundException,任何想法解决这个问题?
【问题讨论】:
-
也显示你的字符串值
-
添加try-catch块和DEBUG
-
是的,它无法正常工作,因为您必须为 HTTPS 安全连接添加 SSL 证书。这就是为什么它不能在 HTTPS 上运行。
-
@PierGiorgioMisley 字符串 => "repository.usd.ac.id/6475/2/119114066_full.pdf"
标签: android pdf activitynotfoundexception