|
|
@ -23,6 +23,7 @@ class FilePickerActivity : |
|
|
|
|
|
|
|
|
|
|
|
private val selectDocTree = |
|
|
|
private val selectDocTree = |
|
|
|
registerForActivityResult(ActivityResultContracts.OpenDocumentTree()) { |
|
|
|
registerForActivityResult(ActivityResultContracts.OpenDocumentTree()) { |
|
|
|
|
|
|
|
it ?: return@registerForActivityResult |
|
|
|
if (it.isContentScheme()) { |
|
|
|
if (it.isContentScheme()) { |
|
|
|
contentResolver.takePersistableUriPermission( |
|
|
|
contentResolver.takePersistableUriPermission( |
|
|
|
it, |
|
|
|
it, |
|
|
@ -33,6 +34,7 @@ class FilePickerActivity : |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private val selectDoc = registerForActivityResult(ActivityResultContracts.OpenDocument()) { |
|
|
|
private val selectDoc = registerForActivityResult(ActivityResultContracts.OpenDocument()) { |
|
|
|
|
|
|
|
it ?: return@registerForActivityResult |
|
|
|
onResult(Intent().setData(it)) |
|
|
|
onResult(Intent().setData(it)) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|