How to get the real path with ACTION_OPEN_DOCUMENT_TREE Intent?

Process of getting real Path from URI is same as before, but with a little addition:

Uri uri = data.getData();
Uri docUri = DocumentsContract.buildDocumentUriUsingTree(uri, 
                        DocumentsContract.getTreeDocumentId(uri));
String path = getPath(this, docUri);

The gist of getPath() method with intermediate methods can be found here: getPath()

Leave a Comment