Reputation: 1
selectedFiles.addAll(getMiscFiles("before"));
This code choose all the files from the folder, but I need to choose one random file only. I couldn't figure out how to do, so every advice is very welcome.
Upvotes: 0
Views: 58
Reputation: 46
If getMiscFiles() returns a list you can: selectedFiles.addAll(getMiscFiles("before").get(0)); This will get the first file from the list and add it to selectedFiles
Upvotes: 1