fix back not moving task to background

This commit is contained in:
andrekir 2022-06-21 11:02:56 -03:00
parent a598b50d40
commit 5328e5d1a2

View file

@ -937,6 +937,14 @@ class MainActivity : BaseActivity(), Logging,
model.meshService = null
}
override fun onBackPressed() { // FIXME Override back button to avoid closing
if (supportFragmentManager.backStackEntryCount == 0) {
moveTaskToBack(false)
} else {
super.onBackPressed()
}
}
override fun onStop() {
unregisterMeshReceiver() // No point in receiving updates while the GUI is gone, we'll get them when the user launches the activity
unbindMeshService()