private void handleResultSelectFiles(final SelectAction action, final Intent intent, final boolean resultOk) {
        final List<Uri> selectedUris = new ArrayList<>();
        if (!resultOk || intent == null) {
            report(true, R.string.contentstorage_file_selection_aborted);
        } else {
            //get selected uris from intent
            if (intent.getData() != null) {
                selectedUris.add(intent.getData());
            }
            if (intent.getClipData() != null) {
                for (int idx = 0; idx < intent.getClipData().getItemCount(); idx++) {
                    final Uri uri = intent.getClipData().getItemAt(idx).getUri();
                    if (uri != null) {
                        selectedUris.add(uri);
                    }
                }
            }

            if (selectedUris.isEmpty()) {
                report(true, R.string.contentstorage_file_selection_aborted);
            } else {
                if (runningIntentData.persistedDocUri != null) {
                    activity.getContentResolver().takePersistableUriPermission(selectedUris.get(0),
                            Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION);

                    ContentStorage.get().setPersistedDocumentUri(runningIntentData.persistedDocUri, selectedUris.get(0));
                }
                report(false, R.string.contentstorage_file_selection_success, selectedUris.get(0));
            }
        }

        callCallback(action, action == SelectAction.SELECT_FILE_MULTIPLE ? selectedUris :
                (action == SelectAction.SELECT_FILE_PERSISTED ? runningIntentData.persistedDocUri :
                        (selectedUris.isEmpty() ? null : selectedUris.get(0))));
    }
You MUST include in {@link Activity#onActivityResult(int, int, Intent)} of using Activity
main/src/main/java/cgeo/geocaching/storage/ContentStorageActivityHelper.java