Thanks, I realised this shortly after I had posted this as usual and forgot to say. It worked on my tablet as there were files, but as you say, on the emulator, there weren't any as I hadn't given it an emulated SD card, so it returned an empty list.
Thanks again