Most visited

Recently visited

Added in API level 24

FileUriExposedException

public class FileUriExposedException
extends RuntimeException

java.lang.Object
   ↳ java.lang.Throwable
     ↳ java.lang.Exception
       ↳ java.lang.RuntimeException
         ↳ android.os.FileUriExposedException


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

This exposure is discouraged since the receiving app may not have access to the shared path. For example, the receiving app may not have requested the READ_EXTERNAL_STORAGE runtime permission, or the platform may be sharing the Uri across user profile boundaries.

Instead, apps should use content:// Uris so the platform can extend temporary permission for the receiving app to access the resource.

This is only thrown for applications targeting N or higher. Applications targeting earlier SDK versions are allowed to share file:// Uri, but it's strongly discouraged.

See also:

Summary

Public constructors

FileUriExposedException(String message)

Inherited methods

From class java.lang.Throwable
From class java.lang.Object

Public constructors

FileUriExposedException

Added in API level 24
FileUriExposedException (String message)

Parameters
message String

Hooray!