I am trying to build a android app where in a part I need to get the containing file names of a specific folder.
String DirectoryPath = "D:\\Images";
File Directory = new File (DirectoryPath);
for(File f:Directory.listFiles())
{
String name = f.getName();
}
I am using above code to reach and get files but an Error occurs which is a null pointer exception. I am pretty aware what it means but can not solve my problem either.
Edit: I changed the wrong written words sory for it.