pull/2129/head
kunfei 2 years ago
parent c9d59bdc42
commit 61cd06f0f8
  1. 4
      app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt

@ -436,8 +436,8 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) {
FileInputStream(image).use { input -> FileInputStream(image).use { input ->
if (uri.isContentScheme()) { if (uri.isContentScheme()) {
DocumentFile.fromTreeUri(context, uri)?.let { doc -> DocumentFile.fromTreeUri(context, uri)?.let { doc ->
DocumentUtils.createFileIfNotExist(doc, image.name) val imageDoc = DocumentUtils.createFileIfNotExist(doc, image.name)!!
context.contentResolver.openOutputStream(doc.uri)!!.use { output -> context.contentResolver.openOutputStream(imageDoc.uri)!!.use { output ->
input.copyTo(output) input.copyTo(output)
} }
} }

Loading…
Cancel
Save