In my app I have a For Next loop that is used to copy all files in a particular folder. Since the target location is a URI, I use the method
given here to copy the files. And it works correctly too.
The problem arises when there are a lot of files to copy. Like there is a user who tried to copy about 3000 files in a folder. He reported that every time he tried, the loop copies a few files and then goes to stay in "not responding" mode. He then force stops it, tries again, copies a few more and then "not responding".
I am wondering if this has something to do with the app running out of resources. I have tried the same with like 10 to 50 files and it never had any issues. But apparently with 1000+ files it hangs.
So is there a right way to lock and release resources after copying each file?