Picking an image file from Gallery using FileProvider

前端 未结 2 1051
耶瑟儿~
耶瑟儿~ 2021-02-18 18:34

Compiling for Android N I\'ve faced an issue of FileProvider. I need to let user to pick image from gallery/take picture with camera then crop it to square.

2条回答
  •  渐次进展
    2021-02-18 19:27

    I think this question is based on a misunderstanding.

    The purpose of a FileProvider is to grant access (to an external app), to a file that your app already controls.

    You will never succeed in using your own file provider to gain access to a file owned by an external app.

    It is up to the external app to grant you that access using a file provider, if it chooses to.

    That seems to be what the question is asking for. If I have not understood your question, let me know, but if I do understand it, what you are trying to do just won't work.

提交回复
热议问题