diff --git a/README.md b/README.md index 8ea89b8..52fecf2 100644 --- a/README.md +++ b/README.md @@ -171,8 +171,11 @@ class MainActivity : AppCompatActivity() { .message(text = "Please select $rootPath") .negativeButton(android.R.string.cancel) .positiveButton { - val initialRoot = if (expectedStorageType.isExpected(selectedStorageType)) selectedStorageType else expectedStorageType - storage.requestStorageAccess(REQUEST_CODE_STORAGE_ACCESS, initialRoot, expectedStorageType) + storage.requestStorageAccess( + REQUEST_CODE_STORAGE_ACCESS, + initialPath = FileFullPath(storage.context, uri.getStorageId(storage.context), ""), + expectedStorageType = expectedStorageType + ) }.show() } @@ -233,7 +236,7 @@ private fun setupFolderPickerCallback() { requestStoragePermission() } - override fun onStorageAccessDenied(requestCode: Int, folder: DocumentFile?, storageType: StorageType) { + override fun onStorageAccessDenied(requestCode: Int, folder: DocumentFile?, storageType: StorageType, storageId: String) { if (storageType == StorageType.UNKNOWN) { requestStoragePermission() return @@ -245,7 +248,7 @@ private fun setupFolderPickerCallback() { ) .negativeButton(android.R.string.cancel) .positiveButton { - storage.requestStorageAccess(REQUEST_CODE_STORAGE_ACCESS, storageType) + storage.requestStorageAccess(initialPath = FileFullPath(baseContext, storageId, "")) }.show() } diff --git a/gradle.properties b/gradle.properties index d033cbf..f62e758 100644 --- a/gradle.properties +++ b/gradle.properties @@ -21,4 +21,4 @@ android.enableJetifier=true kotlin.code.style=official GROUP=com.anggrayudi POM_ARTIFACT_ID=storage -VERSION_NAME=1.5.0-SNAPSHOT \ No newline at end of file +VERSION_NAME=1.5.1-SNAPSHOT \ No newline at end of file