So I have 3 folders in my Android Gallery. I am trying to read the files of these folders into File arrays and then, from there, translate the image source into actual Ima
According to the documentation for File.listFiles(), it will return null
if the File
is not a directory.
There are three (very similar) alternatives as to why this my be...
String
returned by (for example)... Environment.getExternalStorageDirectory().getPath() + "/DressIt Tops/"
doesn't represent a valid directory (the same may apply for ..."/DressIt Bottoms/"
and/or ..."/DressIt Shoes/"
).Strings
returned ARE valid paths BUT one or other of them is a file and NOT a directory.One more thing - never assume any path to anywhere on the Android filesystem - log what Environment.getExternalStorageDirectory().getPath()
actually returns, check it's where you created the directories and also check you have everything in the correct case.