diff --git a/app/src/main/java/io/legado/app/ui/book/changecover/ChangeCoverDialog.kt b/app/src/main/java/io/legado/app/ui/book/changecover/ChangeCoverDialog.kt index 4d03a5753..88a4ddc2b 100644 --- a/app/src/main/java/io/legado/app/ui/book/changecover/ChangeCoverDialog.kt +++ b/app/src/main/java/io/legado/app/ui/book/changecover/ChangeCoverDialog.kt @@ -26,13 +26,12 @@ class ChangeCoverDialog : BaseDialogFragment(), const val tag = "changeCoverDialog" fun show(manager: FragmentManager, name: String, author: String) { - val fragment = (manager.findFragmentByTag(tag) as? ChangeCoverDialog) - ?: ChangeCoverDialog().apply { - val bundle = Bundle() - bundle.putString("name", name) - bundle.putString("author", author) - arguments = bundle - } + val fragment = ChangeCoverDialog().apply { + val bundle = Bundle() + bundle.putString("name", name) + bundle.putString("author", author) + arguments = bundle + } fragment.show(manager, tag) } } diff --git a/app/src/main/java/io/legado/app/ui/book/changesource/ChangeSourceDialog.kt b/app/src/main/java/io/legado/app/ui/book/changesource/ChangeSourceDialog.kt index 3b4068e96..7981e893d 100644 --- a/app/src/main/java/io/legado/app/ui/book/changesource/ChangeSourceDialog.kt +++ b/app/src/main/java/io/legado/app/ui/book/changesource/ChangeSourceDialog.kt @@ -37,13 +37,12 @@ class ChangeSourceDialog : BaseDialogFragment(), const val tag = "changeSourceDialog" fun show(manager: FragmentManager, name: String, author: String) { - val fragment = (manager.findFragmentByTag(tag) as? ChangeSourceDialog) - ?: ChangeSourceDialog().apply { - val bundle = Bundle() - bundle.putString("name", name) - bundle.putString("author", author) - arguments = bundle - } + val fragment = ChangeSourceDialog().apply { + val bundle = Bundle() + bundle.putString("name", name) + bundle.putString("author", author) + arguments = bundle + } fragment.show(manager, tag) } }