I'm trying to access a directory programmatically but listFiles() returns null even though I have files in that directory. I created the directory to the app root using mkdir command and I pushed images to the directory using adb push command. All other directories of the app can be accessed and listFiles() returns null only on the directory I made.

App directories (all others directories content, except for pics, is shown by listFiles()):

Code:
    dex
    inbox
    pics
    right
I have included the needed permissions in AndroidManifest.xml:

Code:
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
Method that goes through the directories (when the recursion reaches pics directory `root.listFiles() = null`:

Code:
 HashMap<File, Bitmap> imageReader(File root) {
        HashMap<File, Bitmap> returnList = new HashMap<>();
        HashMap<File, Bitmap> holderList;

        File[] files = root.listFiles();
        for (int i = 0; i < files.length; i++) {
            if (files[i].isDirectory()) {
                holderList = imageReader(files[i]);
                returnList.putAll(holderList);
            } else {
                if (files[i].getName().endsWith(".jpg") || files[i].getName().endsWith(".jpeg")) {
                    returnList.put(files[i], getFileBitmap(files[i]));
                }
            }
        }
        return returnList;
    }
The UID and GID are same for all the directories

Code:
root@generic_x86:/data/user/0/com.erkki.hellogridview/files/instant-run #
    ls -n
    -rw------- 10058    10058           5 2016-07-25 15:56 active
    drwx------ 10058    10058             2016-07-25 15:38 dex
    drwxrwxrwx 10058    10058             2016-07-25 15:56 inbox
    drwxrwxrwx 10058    10058             2016-07-26 13:08 pics
    drwxr--r-- 10058    10058             2016-07-26 15:18 pics2
    drwx------ 10058    10058             2016-07-25 15:56 right
Thank you for your help