uriForFile

fun uriForFile(context: Context, authority: String, file: File): Uri

Proxy for FileProvider.getUriForFile

Return

A content URI for the file.

Parameters

context

Context for the current component.

authority

The authority of a FileProvider defined in a <provider> element in your app's manifest.

file

File pointing to the filename for which you want a content Uri.

Throws

When the given file is outside the paths supported by the provider.