Android Question EzCamera - android.os.FileUriExposedException: file:///storage/emulated/0/...

nicieri

Active Member
Licensed User
Longtime User
Hi, I have this problem with the version 24+

I tried everything with rp.PERMISSION_WRITE_EXTERNAL_STORAGE

All... but I have this error.

I tried to change File.DirRootExternal for multilpe options... I only need that my app can save the photo, the location is not important.

cam.TakePicture(File.DirRootExternal,"tmp.jpg")


Can any help?

Thanks.
 

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

migliore150267

Member
Licensed User
Longtime User
I solved adding the following code in the activity that use the library EZcamera:

#if java
import android.os.StrictMode;
public void _onCreate() {
StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder();
StrictMode.setVmPolicy(builder.build());
builder.detectFileUriExposure();
}
#End If
 
Upvote 0
Top