I need to get the path of the internal Downloads directory.
Things I have tried:
val home = System.getProperty("user.home")
val downloadsDirectory = File("$home/Downloads"
val downloadsDirectory = File("/storage/emulated/0/Download")
System.getProperty("user.home") just returns an empty string.
I also tried
Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS)
and it returned this path /storage/emulated/0/Download but then the downloadsDirectory.listFiles() method returns null, although I have a file in the directory.