Permission Denial: MediaDocumentsProvider

☆樱花仙子☆ 提交于 2019-12-01 13:07:58

Per the Storage Access Framework client documentation:

  • Use ACTION_GET_CONTENT if you want your app to simply read/import data. With this approach, the app imports a copy of the data, such as an image file.

  • Use ACTION_OPEN_DOCUMENT if you want your app to have long term, persistent access to documents owned by a document provider. An example would be a photo-editing app that lets users edit images stored in a document provider.

As you are using ACTION_GET_CONTENT, your access to the Uri ends when the component is destroyed (unless you pass the Uri to a new component). You must make a copy of the file from the Uri if you'd like to continue to access it beyond the lifetime of your component or switch to ACTION_OPEN_DOCUMENT and persist permissions (possible only with document Uris).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!