Fixed
Status Update
Comments
am...@gmail.com <am...@gmail.com> #2
we've initially planned this for 1.0.0 but didn't make the cut.
bo...@google.com <bo...@google.com> #3
I would add my +1 to this, if only that Room would recognize views (creation being secondary as it can be accomplished with raw queries).
d4...@gmail.com <d4...@gmail.com> #4
+1 For this. View support would be very helpful.
Description
Path:
/extSdCard/_documentTest
Uri:
content://com.android.externalstorage.documents/tree/0000-0000%3A/document/0000-0000%3A_documentTest
SingleDocumentFile doesn't support any write features, so we are left with TreeDocumentFile which is created with:
public static DocumentFile fromTreeUri(Context context, Uri treeUri) {
final int version = Build.VERSION.SDK_INT;
if (version >= 21) {
return new TreeDocumentFile(null, context,
DocumentsContractApi21.prepareTreeUri(treeUri));
} else {
return null;
}
}
However DocumentsContractApi21.prepareTreeUri(treeUri) truncates the document id returning a DocumentFile pointing to:
content://com.android.externalstorage.documents/tree/0000-0000%3A/document/0000-0000%3A
This is NOT the same URI! It simply truncated this URI down to the tree root...
I cannot see a workaround without reflection into TreeDocumentFile.