getFileUriAboveApi24

@RequiresApi(value = 24)
fun getFileUriAboveApi24(file: File, authority: String): Uri

Get the uri by file.

Please register a provider in AndroidManifest.xml. For example:

<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths" />
</provider>

Since

0.5.0

Parameters

authority

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