I am developing an application in android. I am using the storage access framework, and I can select multiple files, but not folders. Is it not possible to select folders?
What we tried 1
Multiple file selections were possible, but not folder selections.
class MainFragment : Fragment() {
private val launcher =
registerForActivityResult(ActivityResultContracts.GetMultipleContents()){ result ->
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
binding.materialButton.setOnClickListener {
launcher.launch(null)
}
}
}
What we tried 2
Multiple selections and file selections were not available.
class MainFragment : Fragment() {
private val launcher =
registerForActivityResult(ActivityResultContracts.OpenDocumentTree()){ result ->
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
binding.materialButton.setOnClickListener {
launcher.launch(null)
}
}
}