From 53d51c8123144ef3f65331652906229973c1e985 Mon Sep 17 00:00:00 2001 From: gedoor Date: Tue, 4 May 2021 19:31:01 +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/ReadBookActivity.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt b/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt index d8d98c9ed..2e616ab44 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt @@ -89,12 +89,14 @@ class ReadBookActivity : ReadBookBaseActivity(), } private val replaceActivity = registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { + it ?: return@registerForActivityResult if (it.resultCode == RESULT_OK) { viewModel.replaceRuleChanged() } } private val searchContentActivity = registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { + it ?: return@registerForActivityResult it.data?.let { data -> data.getIntExtra("index", ReadBook.durChapterIndex).let { index -> viewModel.searchContentQuery = data.getStringExtra("query") ?: ""