SharedStorageFileAccessor

class SharedStorageFileAccessor(registry: ActivityResultRegistry, fileExtension: FileExtension = FileExtension.TtpExtension)

Access a file picker from the device shared storage using Storage Access Framework. The reference to SharedStorageFileAccessor cannot live longer than the activity of the registry.

Important: This is a Public Preview API. It may be changed or removed at any time.

Constructors

Link copied to clipboard
constructor(registry: ActivityResultRegistry, fileExtension: FileExtension = FileExtension.TtpExtension)

Functions

Link copied to clipboard
fun pickFile(context: Context, callback: FilePickedCallback)

Pick the document from the device shared storage. The successful file picking is notified with the callback. The picked file has to be of the provided extension.