private void handleResultPersistableFolderSelection(final Intent intent, final boolean resultOk) {
        final Uri uri = !resultOk || intent == null ? null : intent.getData();
        final PersistableFolder folder = runningIntentData.folder;
        if (uri == null) {
            finalizePersistableFolderSelection(false, folder, null, runningIntentData.action);
        } else {
            final int flags = Intent.FLAG_GRANT_READ_URI_PERMISSION | (runningIntentData.folder.needsWrite() ? Intent.FLAG_GRANT_WRITE_URI_PERMISSION : 0);
            activity.getContentResolver().takePersistableUriPermission(uri, flags);
            ContentStorage.get().refreshUriPermissionCache();

            //Test if access is really working!
            final Folder target = Folder.fromDocumentUri(uri);
            if (!ContentStorage.get().ensureFolder(target, runningIntentData.folder.needsWrite(), true)) {
                finalizePersistableFolderSelection(false, folder, null, runningIntentData.action);
            } else {
                continuePersistableFolderSelectionCheckFoldersAreEqual(folder, uri, flags, runningIntentData.copyChoice, runningIntentData.action);
            }
        }
    }
You MUST include in {@link Activity#onActivityResult(int, int, Intent)} of using Activity
main/src/main/java/cgeo/geocaching/storage/ContentStorageActivityHelper.java