In my application i used to show to the user all the files with a specific extension available in his "Downloads" directory :
File dir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS);
return dir.listFiles(new FilenameFilter() {
public boolean accept(File dir, String name) {
return name.toLowerCase().endsWith(".ext");
}
});
It seems that this is not working anymore on android 11 and 10 (maybe below ?).
After investigation i found that listFiles()
or list()
now only return image file and not all the files as it used to be.
Almost like if a "default filter" was applied. Therefore my ".ext" files doesn't show anymore
What can i do to be able to see my ".ext" file and not only image file ?
Note that using the standard Filepicker to choose a file is not really an option , i have to stay in the app workflow.