I am trying to get access to "/"
(root) directory using Storage Access Framework
on Android 7.0 and above, after looking to the Google sample on GitHub, i can see that there are only predefined directories are passed in while creating accessIntent using StorageVolume class, but how to get access to any other directory than those predefined directories?
Here is my code, which i tried:
StorageManager storageManager = (StorageManager) getSystemService(Context.STORAGE_SERVICE);
File root = new File("/");
StorageVolume storageVolume = storageManager.getStorageVolume(root);
Intent intent = storageVolume.createAccessIntent("/");
startActivityForResult(intent, REQUEST_CODE);
i am getting null as storageVolume and unable to get access to "/" directory using StorageVolume framework.
How to get Scoped Directory Access to
"/"
directory using Storage Access Framework on Android 7.0 and above?