What I want
One of the features of my App is to Download files. I want to give the user the opportunity to open the folder, which contains the downloaded files, so that he can browse through them and open them in whatever application he likes. So I have a button, which should open a path to this directory in one of the installed file managers.
What I have
So far I've been referring to this solution: Android: How to open a specific folder via Intent and show its content in a file browser?
private fun openDirectoryInFileManager(directoryPath: String) {
val intent = Intent(Intent.ACTION_VIEW)
val uri = Uri.parse(directoryPath)
intent.setDataAndType(uri, "*/*")
startActivity(intent)
}
This code opens a pop-up window, which suggests all kinds of installed applications, to open that Uri. Screenshot of the pop-up window
So far I've been able to select the app Total Commander to open the Uri with and it took me right to the chosen directory. However, since a recent update of Total Commander this is not possible anymore. All the other installed file managers seem not to be able to open the path. They just open the Downloads directory, no matter which path is passed to them.
Is there a better solution to open any directory path in Android? Or does anyone know an application, which supports opening a handed directory path?