diff --git a/app/src/main/java/io/legado/app/ui/importbook/ImportBookActivity.kt b/app/src/main/java/io/legado/app/ui/importbook/ImportBookActivity.kt index 4dcd75776..191dbc10a 100644 --- a/app/src/main/java/io/legado/app/ui/importbook/ImportBookActivity.kt +++ b/app/src/main/java/io/legado/app/ui/importbook/ImportBookActivity.kt @@ -79,7 +79,12 @@ class ImportBookActivity : VMBaseActivity(R.layout.activity when (requestCode) { requestCodeSelectFolder -> if (resultCode == Activity.RESULT_OK) { data?.data?.let { - + contentResolver.takePersistableUriPermission( + it, + Intent.FLAG_GRANT_READ_URI_PERMISSION or Intent.FLAG_GRANT_WRITE_URI_PERMISSION + ) + AppConfig.importBookPath = it.toString() + upPath() } } }