FileOpenRequest

class FileOpenRequest(context: ComponentActivity) : Closeable

Prompt the user to open a document

Manages Android activity/intent required to open a document in shared storage and read its contents using a FileChannel. This class must be initialized in ComponentActivity.onCreate, then can be used to create message buffers for use with the MessageBuilder returned from IRemoteSupportClient.getMessageBuilder.

Constructors

Link copied to clipboard
fun FileOpenRequest(context: ComponentActivity)

Create empty File open request

Functions

Link copied to clipboard
open override fun close()

Unregister the activity result request

Link copied to clipboard
suspend fun <T> openFile(vararg mimetype: String, scopedReader: suspend (FileChannel) -> T): T?

Prompt the user to open a file. After the user selects a file, the scopedReader is executed on a read-only FileChannel created from the file selected by the user. The FileChannel is closed after scopedReader finishes executing.