getUriForFile

open fun getUriForFile(@NonNull context: Context, @NonNull fileName: File): Uri

Return a content URI for a file stored in getSharedFileDirectory directory.

Parameters

context

Context of the calling component, used for accessing files.

fileName

File name of the targeted file, must be part of the shared directory.