I started to develop an Android app, in which I would like to implement an Import/Export system where you can import and export the data in txt files.
To create the import part, I made a file browser, which displays the content of the currently opened directory (sub-directories and txt files), just like this:
string[ ] subdirectories = Directory.GetDirectories(currentpath, “*”, SearchOption.TopDirectoryOnly);
string[ ] txtfiles = Directory.GetFiles(currentpath, “*.txt”, SearchOption.TopDirectoryOnly);
//display them
The GetDirectories part works fine, it’s the GetFiles() that behaves oddly.
The problem is, that the Directory.GetFiles() doesn’t return the txt files unless they were created by the app (with the export function), which is quite unpractical.
I appreciate any feedback.
UPDATE: I tried running my program on a Xiaomi, a Samsung and a Huawei phone (I had given the file access permission on all of them beforehand) and the problem only occurs on the Xiaomi one, so it probably has something to do with MIUI.