Saving an image after getting folder from Storage Access Framework UI

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-08 19:31:28

how can i check if folder exist

DocumentFile has an exists() method. In theory, pickedDir.exists() should tell you if it exists. In practice, it is up to the storage provider.

I also want to use ParcelFileDescriptor to save same image with this method

That code has bugs:

  • You cannot grant yourself permissions using grantUriPermission()

  • You cannot invent arbitrary Uri values via concatenation, particularly for a provider that is not yours

How can I fix this

Delete it.

which method is more preferable

The first one.

and why?

The first one will work, perhaps with minor adjustment. The second one has no chance of working.

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