加上exitProcess
This commit is contained in:
parent
77df0eb8a5
commit
d8d351831c
@ -12,6 +12,7 @@ class MyApplication : Application(), Application.ActivityLifecycleCallbacks {
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
instance = this
|
||||
registerActivityLifecycleCallbacks(this)
|
||||
}
|
||||
|
||||
private var currentActivity: Activity? = null
|
||||
@ -32,7 +33,7 @@ class MyApplication : Application(), Application.ActivityLifecycleCallbacks {
|
||||
|
||||
override fun onActivityDestroyed(p0: Activity) {
|
||||
if (currentActivity?.equals(p0) == true) {
|
||||
Log.e("APP", "EXIT...")
|
||||
Log.e("MyApplication", "EXIT...")
|
||||
onTerminate()
|
||||
exitProcess(0)
|
||||
}
|
||||
|
||||
@ -47,14 +47,16 @@ class MainActivity : AppCompatActivity() {
|
||||
initObservers()
|
||||
}
|
||||
|
||||
override fun onBackPressed() {
|
||||
super.onBackPressed()
|
||||
finish()
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
MainScope().launch {
|
||||
for (i in 0 until splitVideoViewAdapter.itemCount) {
|
||||
splitVideoViewAdapter.destroy(i)
|
||||
//delay(100)
|
||||
}
|
||||
for (i in 0 until splitVideoViewAdapter.itemCount) {
|
||||
splitVideoViewAdapter.destroy(i)
|
||||
}
|
||||
super.onDestroy()
|
||||
}
|
||||
|
||||
private fun initContentView() = binding.apply {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user