From da6f786e7214956541cf939e9a006321f2833731 Mon Sep 17 00:00:00 2001 From: gedoor Date: Wed, 1 Sep 2021 14:22:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20Fragment=20not=20attached?= =?UTF-8?q?=20to=20Activity?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/legado/app/ui/config/BackupConfigFragment.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/config/BackupConfigFragment.kt b/app/src/main/java/io/legado/app/ui/config/BackupConfigFragment.kt index b6edf842b..fd1e8d5f1 100644 --- a/app/src/main/java/io/legado/app/ui/config/BackupConfigFragment.kt +++ b/app/src/main/java/io/legado/app/ui/config/BackupConfigFragment.kt @@ -236,9 +236,9 @@ class BackupConfigFragment : BasePreferenceFragment(), Coroutine.async { Backup.backup(requireContext(), backupPath) }.onSuccess { - activity?.toastOnUi(R.string.backup_success) + appCtx.toastOnUi(R.string.backup_success) }.onError { - activity?.toastOnUi(R.string.backup_fail) + appCtx.toastOnUi(R.string.backup_fail) } } else { backupDir.launch(null) @@ -258,9 +258,9 @@ class BackupConfigFragment : BasePreferenceFragment(), AppConfig.backupPath = path Backup.backup(requireContext(), path) }.onSuccess { - activity?.toastOnUi(R.string.backup_success) + appCtx.toastOnUi(R.string.backup_success) }.onError { - activity?.toastOnUi(R.string.backup_fail) + appCtx.toastOnUi(R.string.backup_fail) } } .request()