I\'m trying to save pictures in a subfolder on Android. Here\'s a bit of my code:
File path = Environment.getExternalStoragePublicDirectory(Environment.DIREC
The way used in Baschi's answer doesn't always work for me. Well, here is a full solution.
// Snippet taken from question
File path = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM);
path = new File(path, "SubDirName");
path.mkdirs();
// Fix
path.setExecutable(true);
path.setReadable(true);
path.setWritable(true);
// Initiate media scan and put the new things into the path array to
// make the scanner aware of the location and the files you want to see
MediaScannerConnection.scanFile(this, new String[] {path.toString()}, null, null);