Skip to content
Advertisement

shared image file in Kotlin android studio

I have an application in which I try to share a photo, but when you share the application it crashes.

JavaScript

log:

JavaScript

Advertisement

Answer

The exception raised is

JavaScript

FileUriExposedException is caused by

The exception that is thrown when an application exposes a file:// Uri to another app.

When targeting Api 24 or higher you need to use a content provider to share a file with another app.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement