From 0bcc5afc47ba62fb71a48f928f93d07fe00eed46 Mon Sep 17 00:00:00 2001 From: kunfei Date: Mon, 18 Nov 2019 10:53:45 +0800 Subject: [PATCH] up --- .../java/io/legado/app/ui/book/read/ReadBookActivity.kt | 9 --------- app/src/main/java/io/legado/app/ui/main/MainActivity.kt | 5 +++++ 2 files changed, 5 insertions(+), 9 deletions(-) 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 95b2151c3..7fd8b30c8 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 @@ -11,7 +11,6 @@ import android.view.MenuItem import androidx.core.view.isVisible import androidx.lifecycle.Observer import com.jaredrummler.android.colorpicker.ColorPickerDialogListener -import io.legado.app.BuildConfig import io.legado.app.R import io.legado.app.base.VMBaseActivity import io.legado.app.constant.Bus @@ -20,7 +19,6 @@ import io.legado.app.data.entities.Book import io.legado.app.data.entities.BookChapter import io.legado.app.help.IntentDataHelp import io.legado.app.help.ReadBookConfig -import io.legado.app.help.storage.Backup import io.legado.app.lib.dialogs.alert import io.legado.app.lib.dialogs.noButton import io.legado.app.lib.dialogs.okButton @@ -532,13 +530,6 @@ class ReadBookActivity : VMBaseActivity(R.layout.activity_boo } ?: super.finish() } - override fun onDestroy() { - super.onDestroy() - if (!BuildConfig.DEBUG) { - Backup.autoBackup() - } - } - override fun observeLiveBus() { super.observeLiveBus() observeEvent(Bus.ALOUD_STATE) { diff --git a/app/src/main/java/io/legado/app/ui/main/MainActivity.kt b/app/src/main/java/io/legado/app/ui/main/MainActivity.kt index c5e9a34b4..46eaa1deb 100644 --- a/app/src/main/java/io/legado/app/ui/main/MainActivity.kt +++ b/app/src/main/java/io/legado/app/ui/main/MainActivity.kt @@ -9,12 +9,14 @@ import androidx.fragment.app.FragmentPagerAdapter import androidx.viewpager.widget.ViewPager import com.google.android.material.bottomnavigation.BottomNavigationView import io.legado.app.App +import io.legado.app.BuildConfig import io.legado.app.R import io.legado.app.base.VMBaseActivity import io.legado.app.constant.Bus import io.legado.app.help.ActivityHelp import io.legado.app.help.permission.Permissions import io.legado.app.help.permission.PermissionsCompat +import io.legado.app.help.storage.Backup import io.legado.app.lib.dialogs.alert import io.legado.app.lib.dialogs.noButton import io.legado.app.lib.dialogs.yesButton @@ -115,6 +117,9 @@ class MainActivity : VMBaseActivity(R.layout.activity_main), if (ActivityHelp.size() > 1) { moveTaskToBack(true) } else { + if (!BuildConfig.DEBUG) { + Backup.autoBackup() + } super.finish() } }