Issue #4513: fix mismatched bookmark listener lifecycles
The mismatch here was creating potentially inconsistent states. When first put into a CREATED or STARTED state, the listener would not be active, however after going through onResume it would then stay active until destroyed. We should only be navigating to bookmarks when in a RESUMED state, so this change should be safe. I tried it a few times to verify. But I've been wrong before!master
parent
de93b05cac
commit
96472a533a
|
@ -23,7 +23,7 @@ class BookmarkDeselectNavigationListener(
|
|||
navController.addOnDestinationChangedListener(this)
|
||||
}
|
||||
|
||||
@OnLifecycleEvent(Lifecycle.Event.ON_DESTROY)
|
||||
@OnLifecycleEvent(Lifecycle.Event.ON_PAUSE)
|
||||
fun onDestroy() {
|
||||
navController.removeOnDestinationChangedListener(this)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue