-1
您好我是新的android系统中我有一个存在于这个路径的一些PDF文件无法打开asset/pdf/example.pdf
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);
我得到这个错误&知道这是因为第三方无法访问文件 什么是解决方案?
老兄在提问之前我也读过你的GITHUB项目,但不能再处理它!我新,不知道如何使用流提供程序你可以写在我的文件路径基础,并给我例子? –
@MohamadAmin:[StreamProvider'' demo /'project](https://github.com/commonsguy/cwac-provider/tree/master/demo)演示了如何从资产中提供文件等等。因此,我的许多书籍的拖放式样本,例如[this one](https://github.com/commonsguy/cw-omnibus/tree/master/DragDrop/Legacy)(StreamProvider)用于'drag /'app模块)。 – CommonsWare
我无法处理:(尝试两个小时 –