From 61cd06f0f8bc3e77a58c21a5e6ce27994d0eec72 Mon Sep 17 00:00:00 2001 From: kunfei Date: Wed, 3 Aug 2022 22:17:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt b/app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt index a47940381..803bc9587 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt +++ b/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 -> if (uri.isContentScheme()) { DocumentFile.fromTreeUri(context, uri)?.let { doc -> - DocumentUtils.createFileIfNotExist(doc, image.name) - context.contentResolver.openOutputStream(doc.uri)!!.use { output -> + val imageDoc = DocumentUtils.createFileIfNotExist(doc, image.name)!! + context.contentResolver.openOutputStream(imageDoc.uri)!!.use { output -> input.copyTo(output) } }