Merge pull request #450 from andrekir/back-stack

fix back not moving task to background
This commit is contained in:
Andre Kirchhoff
2022-06-21 11:18:40 -03:00
committed by GitHub

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()