CreateVideoContract
private val registerDocumentContract = registerForActivityResult(CreateVideo()) { if (it == null) { //Operation cancelled or no application to handle the action! } else { val uri = it } }
call it as tryOrIgnore { registerDocumentContract.launch(videoName.mp4) } it's wrapped in try or ignore in case no app can handle the intent