Basically, my question is somewhat similar to this, and I've used the solution given to that. The problem is, it will only work if the file came from the internal storage, and this is the cause of it:
in this part of the code (in the solution in the question I mentioned):
if (isExternalStorageDocument(uri)) {
final String docId = DocumentsContract.getDocumentId(uri);
final String[] split = docId.split(":");
final String type = split[0];
if ("primary".equalsIgnoreCase(type)) {
return Environment.getExternalStorageDirectory() + "/" + split[1];
}
// TODO handle non-primary volumes
}
there is no following else statement. I've searched for ways to access that non-primary volumes but I can't find any answer.