Search code examples
androidandroid-permissionsandroid-sdcardandroid-memory

How to get write permission on Android 7 SD-card using StorageVolume?


Even after getting a permanent permission to write to the external storage I can't get write access to every folder of my sd-card. How to get those? For instance this app can do this, and I guess second permission dialog (under "Write permission on Android 7") is all about that. How to create that? Article Maybe, the solution is bound to the createAccessIntent method of StorageVolume class somehow...

Here is a code I'm currently using to get permanent permission:

RxPermissions.getInstance(getActivity())
                .request(Manifest.permission.WRITE_EXTERNAL_STORAGE)
                .subscribe(granted -> {
                    if (!granted) return;
                    showAlternativeDirectoryChooser(); // success
                }, throwable -> {
                });

Solution

  • Maybe, the solution is bound to the createAccessIntent method of StorageVolume class somehow

    Correct.

    Here is a code I'm currently using to get permanent permission:

    That has nothing to do with removable storage. That code is for external storage.