Created
September 7, 2025 10:32
-
-
Save root-ansh/1d8059aa0161d6550f18faa8f575dd6e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private val getFileFromSystem: ActivityResultLauncher<Intent> = registerForActivityResult(StartActivityForResult()) { result -> | |
| if (result.resultCode == RESULT_OK) { | |
| val uri = result.data?.data | |
| lifecycleScope.launch { | |
| val file = uri?.toLocalFile(this@XMLActivity) // convert to local file | |
| updateUi()// handle local file | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment