private val directoryLauncher =
registerForActivityResult(
ActivityResultContracts.StartActivityForResult()
) {...}
val i = Intent(Intent.ACTION_OPEN_DOCUMENT_TREE)
directoryLauncher.launch(Intent.createChooser(i, "Choose directory"))
I used to use this piece of code to launch a folder picker with the AOSP Files app. Now when I try it on my new Xiaomi phone, it launches a file picker on the Xiaomi File Manager app. Is there an alternative that works on all phones?