pull/32/head
kunfei 5 years ago
parent 0ff5d733e6
commit 91acb02340
  1. 3
      app/src/main/java/io/legado/app/base/BaseActivity.kt

@ -8,6 +8,7 @@ import android.view.View
import android.view.WindowManager import android.view.WindowManager
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import io.legado.app.R import io.legado.app.R
import io.legado.app.help.ActivityHelp
import io.legado.app.lib.theme.ATH import io.legado.app.lib.theme.ATH
import io.legado.app.lib.theme.ColorUtils import io.legado.app.lib.theme.ColorUtils
import io.legado.app.lib.theme.ThemeStore import io.legado.app.lib.theme.ThemeStore
@ -26,6 +27,7 @@ abstract class BaseActivity(private val layoutID: Int, private val fullScreen: B
initTheme() initTheme()
setupSystemBar() setupSystemBar()
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
ActivityHelp.getInstance()?.add(this)
setContentView(layoutID) setContentView(layoutID)
onActivityCreated(savedInstanceState) onActivityCreated(savedInstanceState)
observeLiveBus() observeLiveBus()
@ -34,6 +36,7 @@ abstract class BaseActivity(private val layoutID: Int, private val fullScreen: B
override fun onDestroy() { override fun onDestroy() {
super.onDestroy() super.onDestroy()
cancel() cancel()
ActivityHelp.getInstance()?.remove(this)
} }
abstract fun onActivityCreated(savedInstanceState: Bundle?) abstract fun onActivityCreated(savedInstanceState: Bundle?)

Loading…
Cancel
Save