【发布时间】:2017-01-25 15:43:14
【问题描述】:
嗨,我是 android 新手,我有一些 PDF 文件存在于此路径 asset/pdf/example.pdf
当我尝试使用此代码的 PDF 文件时
Intent intent = new Intent(Intent.ACTION_VIEW);
File file = new File("file:///android_asset/pdf/example.pdf");
intent.setDataAndType( Uri.fromFile( file ), "application/pdf" );
startActivity(intent);
我收到此错误并知道这是因为第三方无权访问文件 什么是解决方案?
【问题讨论】: