Skip to content

FileUriExposedException: #659

@jjimenez0611

Description

@jjimenez0611

I have this error..
Caused by: android.os.FileUriExposedException: file:///storage/emulated/0/Android/data/com.soin.TSA/cache/pickImageResult.jpeg exposed beyond app through ClipData.Item.getUri()

Looks like this happens on Android N

if (Build.VERSION.SDK_INT >=  Build.VERSION_CODES.N) {
          imageUri = Uri.parse(filepath);
    } else{
           imageUri = Uri.fromFile(new File(filepath));
    }

The method getCaptureImageOutputUri() use Uri.fromFile

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions