1
0
Fork 0

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
Severin Rudie 2019-09-24 16:43:11 -07:00 committed by Emily Kager
parent de93b05cac
commit 96472a533a
1 changed files with 1 additions and 1 deletions

View File

@ -23,7 +23,7 @@ class BookmarkDeselectNavigationListener(
navController.addOnDestinationChangedListener(this)
}
@OnLifecycleEvent(Lifecycle.Event.ON_DESTROY)
@OnLifecycleEvent(Lifecycle.Event.ON_PAUSE)
fun onDestroy() {
navController.removeOnDestinationChangedListener(this)
}