How to update content when accessing Google Drive using SAF

I am trying to access PDF files from a Google drive in my application with the following code:

Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.setType("application/pdf");
startActivityForResult(intent, MY_ACTION_OPEN_DOCUMENT);

which was taken from Google documentation directly. I can get a file collector. However, there are 2 problems:

  • Unable to update file collector contents.
  • Files recently added to your Google Drive account will not appear until I go to the Google Drive app and update there.

I am wondering if there is anything in my implementation. I tried to search the Internet and surprisingly found nothing. More surprisingly, I have the same issue with the gmail app.

Thanks in advance.

+5
source share
1 answer

/ (queryDocument queryChildDocuments). Google SAF. SAF . , ..

, .

https://medium.com/androiddevelopers/building-a-documentsprovider-f7f2fb38e86a.

0

All Articles