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