Android Android.os.fileuriexposedexception Error In Android N
I have images in external storage in Orders folder and that image i am trying to share to external apps using intent File file = new File(Environment.getExternalStorageDirectory()
Solution 1:
You must use FileProvider when you want to share files to other apps.
check https://developer.android.com/training/secure-file-sharing/setup-sharing.
use FileProvider.getUriForFile to get Uri instead of Uri.fromFile(file)
in you code.
FileProvider.getUriForFile(this,"your_package.fileprovider",photoFile);
Post a Comment for "Android Android.os.fileuriexposedexception Error In Android N"