How to update file list in Android SAF

SAF does not update the file list. I tested this on a Samsung Galaxy S4 with Android KitKat.

When I use an application that accesses the default Downloads provider in SAF, I see files that have already been deleted. Right now I have two files, I confirmed this by checking /sdcard/Download/ using adb and using the phone’s My Files application, but SAF displays a list of over a hundred files. As a result, when I select one of those already deleted files, the application tells me that the file does not exist (which, of course, is correct).

Anyone else run into this issue? Any solutions for updating the list displayed by SAF?


Update: I tried it with Nexus 5 and Android 5.1, and the same thing happens. I believe that I misinterpreted the purpose of the Downloads provider.

The Downloads provider, available through SAF, shows the history of downloaded files (which usually fall into the download folder). If we go to the download directory and delete the files, these files will not be deleted from the Downloads provider, because it shows the history of the downloaded files, and not the list of actual files present in the directory.

When adding a file via copy / paste in nautilus, after installing the phone in ubuntu, this file is not displayed in the Downloads provider.

So how do we get rid of this story? There is an application called Rain, Downloads. Open the application and delete the files there or clear them all, just like me, and the files will disappear.

(The SAF provider for Google Drive correctly reflects what you do outside of it, so use it for testing.)

+6
source share

Source: https://habr.com/ru/post/985126/


All Articles