Android 7.0 camera problem

问题:android.os.FileUriExposedException: file:///storage/emulated/0/Android/data/包名/cache/pickImageResult.jpeg exposed beyond app through ClipData.Item.getUri()。


error code:


solve:

Create an xml folder in res, and create file_paths.xml in the folder, as shown in the figure:


Custom name and path:


Add the file provider in AndroidManifest.xml, as shown in the figure:

Use in code:


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325439268&siteId=291194637