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 1b5966efb..a059e380d 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 @@ -13,7 +13,6 @@ 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.storage.Backup import io.legado.app.lib.theme.ATH import io.legado.app.service.BaseReadAloudService @@ -113,14 +112,10 @@ class MainActivity : VMBaseActivity(R.layout.activity_main), } override fun finish() { - if (ActivityHelp.size() > 1) { - moveTaskToBack(true) - } else { - if (!BuildConfig.DEBUG) { - Backup.autoBackup() - } - super.finish() + if (!BuildConfig.DEBUG) { + Backup.autoBackup() } + super.finish() } override fun onDestroy() { diff --git a/app/src/main/java/io/legado/app/ui/rss/read/ReadRssActivity.kt b/app/src/main/java/io/legado/app/ui/rss/read/ReadRssActivity.kt index f20be3f87..5eb701ebc 100644 --- a/app/src/main/java/io/legado/app/ui/rss/read/ReadRssActivity.kt +++ b/app/src/main/java/io/legado/app/ui/rss/read/ReadRssActivity.kt @@ -2,6 +2,7 @@ package io.legado.app.ui.rss.read import android.annotation.SuppressLint import android.os.Bundle +import android.view.KeyEvent import android.view.Menu import android.view.MenuItem import android.webkit.WebSettings @@ -90,4 +91,18 @@ class ReadRssActivity : VMBaseActivity(R.layout.activity_rss_r } DrawableUtils.setTint(starMenuItem?.icon, primaryTextColor) } + + override fun onKeyUp(keyCode: Int, event: KeyEvent?): Boolean { + event?.let { + when (keyCode) { + KeyEvent.KEYCODE_BACK -> if (event.isTracking && !event.isCanceled && webView.canGoBack()) { + if (webView.copyBackForwardList().size > 1) { + webView.goBack() + return true + } + } + } + } + return super.onKeyUp(keyCode, event) + } } \ No newline at end of file