How can I recursively scan directories in Android and display file name(s)? I’m trying to scan, but it’s slow (force close or wait). I’m using the FileWalker class given in a separate answer to this question.
How can I recursively scan directories in Android and display file name(s)? I’m trying
Share
You should almost always access the file system only from a non-UI thread. Otherwise you risk blocking the UI thread for long periods and getting an ANR. Run the FileWalker in an
AsyncTask‘sdoInBackground().This is a slightly optimized version of FileWalker:
You can invoke it from a background thread like this: