本地书籍无权限则保存到自己选定的文件夹

pull/1486/head
gedoor 3 years ago
parent a8970d7c1f
commit 818bda53ac
  1. 11
      app/src/main/java/io/legado/app/ui/association/FileAssociationActivity.kt

@ -25,12 +25,15 @@ class FileAssociationActivity :
VMBaseActivity<ActivityTranslucenceBinding, FileAssociationViewModel>() {
private val localBookTreeSelect = registerForActivityResult(HandleFileContract()) {
it.uri?.let { treeUri ->
AppConfig.defaultBookTreeUri = treeUri.toString()
intent.data?.let { uri ->
intent.data?.let { uri ->
it.uri?.let { treeUri ->
AppConfig.defaultBookTreeUri = treeUri.toString()
importBook(treeUri, uri)
} ?: let {
toastOnUi("不选择文件夹重启应用后可能没有权限访问")
viewModel.importBook(uri)
}
} ?: finish()
}
}
override val binding by viewBinding(ActivityTranslucenceBinding::inflate)

Loading…
Cancel
Save