简体   繁体   English

如何使用外部应用程序访问存储在内部存储的自定义文件夹中的文件?

[英]How to access files which is stored in custom folder of internal storage using external app?

I have a zip file. 我有一个zip文件。 I am unzipping it to internal storage. 我将其解压缩到内部存储中。 When unzipping each file, I am keeping the same folder structure. 解压缩每个文件时,我保持相同的文件夹结构。 After unzipping all levels, I want to display the files using appropriate third party apps like adobe reader etc. 解压缩所有级别后,我想使用适当的第三方应用程序(如Adobe Reader等)显示文件。

I can unzipping and creating files with same folder structure. 我可以解压缩并创建具有相同文件夹结构的文件。 But the problem is the files could not be displayed through external app, because of permission. 但问题是由于权限的原因,这些文件无法通过外部应用程序显示。 I couldn't set WORLD_READABLE PERMISSION, because the files are storing in custom folders. 我无法设置WORLD_READABLE PERMISSION,因为文件存储在自定义文件夹中。 I applied setReadable also. 我也应用了setReadable。 But no hope. 但是没有希望。

How can I show files, or how to get permission to files? 如何显示文件,或如何获得文件许可?

Any help would be appreciated.. 任何帮助,将不胜感激..

Thanks Jomia 谢谢乔米亚

Use FileProvider to serve up the files from your app's internal storage using a ContentProvider . 使用FileProvider使用ContentProvider从应用程序的内部存储中提供文件。

Or, put the files on external storage, instead of internal storage. 或者,将文件放在外部存储而不是内部存储上。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM