pull/49/head
kunfei 5 years ago
parent d24cbdf3b0
commit 0bcc5afc47
  1. 9
      app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt
  2. 5
      app/src/main/java/io/legado/app/ui/main/MainActivity.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<ReadBookViewModel>(R.layout.activity_boo
} ?: super.finish()
}
override fun onDestroy() {
super.onDestroy()
if (!BuildConfig.DEBUG) {
Backup.autoBackup()
}
}
override fun observeLiveBus() {
super.observeLiveBus()
observeEvent<Int>(Bus.ALOUD_STATE) {

@ -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<MainViewModel>(R.layout.activity_main),
if (ActivityHelp.size() > 1) {
moveTaskToBack(true)
} else {
if (!BuildConfig.DEBUG) {
Backup.autoBackup()
}
super.finish()
}
}

Loading…
Cancel
Save