When I plug my device into big computer I see the following picture
How to find these (two) directories programmatically from withing Android application?
UPDATE
I wrote utility class to deduce roots. Unfortunately, it works for minSdkVersion=19
public class RootsUtil {
private final static String seed = Environment.DIRECTORY_PICTURES;
public final static File[] getRoots(Context context) {
File[] paths = context.getExternalFilesDirs(seed);
if( paths.length <= 1 ) {
return new File[] { Environment.getExternalStorageDirectory() };
}
else {
while(true) {
int count = 1;
for (int i = 1; i < paths.length; ++i) {
if (paths[0].getName().equals(paths[i].getName())) {
count++;
}
}
if( count==paths.length ) {
for (int i = 0; i < paths.length; ++i) {
paths[i] = paths[i].getParentFile();
}
}
else {
break;
}
}
return paths;
}
}
}
The question persists: are there any solutions for at least SDK=15?
P.S.
People downvoting this (absolutely normal) question: you are just declaring yourselves a clowns.