please how can I list all files inside a folder?
I try to do that with that code

```
    File theFolder = new File(Environment.getExternalStorageDirectory()+File.separator +"TestFolder");

    if(theFolder.exists())
    {
        Log.d("theFolder", "theFolderExiste ");
        File [] files = theFolder.listFiles();

        Log.d("Files", "files: "+files.length);

        for(File file : files)
        {
            Log.d("file ", "file name : "+file.getName());
        }

    }else
        {
            Log.d("theFolder", "we dont have that folder ");
        }

```

but hi give me that error
Caused by: java.lang.NullPointerException: Attempt to get length of null array
at com.joshuabutton.documentscanner.DisplayListOfFiles.onCreate(DisplayListOfFiles.java:76)

and I have files inside that folder as you can see in that pic [![enter image description here](https://i.stack.imgur.com/tuCfp.png)](https://i.stack.imgur.com/tuCfp.png)