I am trying to list non-media content from Download folder using SAF.
Sample Code:
public void openDirectory(Uri uriToLoad) {
// Choose a directory using the system's file picker.
Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT_TREE);
// Provide read access to files and sub-directories in the user-selected
// directory.
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
// Optionally, specify a URI for the directory that should be opened in
// the system file picker when it loads.
intent.putExtra(EXTRA_INITIAL_URI, uriToLoad);
startActivityForResult(intent, 500);
}
But when i open the Download Folder using SAF i see the "use this folder" button is disable.
I also noticed from the android documents they introduced new MediaStore.Download
https://developer.android.com/reference/android/provider/MediaStore.Downloads
i tried to use but i see the cursor count is zero. When should we use the above api ?