When you create a file in android, you have to call MediaScannerConnection.scanFile() on it, so that it gets displayed in the file explorer.
However, when I try to do this with a directory it gets treated as a file.
File dir = new File("folder/subfolder/folder2");
dir.mkdirs();
MediaScannerConnection.scanFile(_context, new String[]{dir.getAbsolutePath()}, null, null);
"folder2" should be a directory not a file. How can I fix this?