It appears that Google Drive has an activity that responds to the GET_CONTENT action, but that it's not exported.
Is there another method that I can use in my app to pull content out of Drive, without having to initiate the process from Drive? Writing a picker/chooser activity myself and using the backend APIs to list and open a file is obviously an option, but I'd much rather use Drive's own UI to do that.
Google Drive only has an activity that supports GET_CONTENT
to support pre-API 19 devices. As per the Storage Access Framework guide, the GET_CONTENT
activity must be disabled on API 19+ devices to prevent a duplicate with the DocumentsProvider.
The whole point of the Storage Access Framework is that it provides a single UI (started when you use startActivity
with a GET_CONTENT
, OPEN_DOCUMENT
, or OPEN_DOCUMENT_TREE
Intent) that allows users to pick from any source, including local storage, Google Drive, or any other app. And your app can then access the selected file(s) using the exact same code.
There is no functionality that allows you to specify that only a single root (such as Google Drive) should appear. Users will always be able to select from any available root.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With