getFileUriAboveApi24

@RequiresApi(value = 24)
abstract 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>

Parameters

authority

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