While loading the EPUB navigator's initial locator, calling certain APIs too early, like submitPreferences(), can cause us to lose it. This happens because the currentLocator goes through various temporary positions before settling on the requested initial locator. If we invalidate the view pager while loading, the pending locator is cleared and replaced with the current state of the currentLocator.
I solved this by adding a State in the EpubNavigatorFragment to monitor the loading of pending locators. currentLocator will only update after the requested locator finishes loading.
While loading the EPUB navigator's initial locator, calling certain APIs too early, like
submitPreferences()
, can cause us to lose it. This happens because thecurrentLocator
goes through various temporary positions before settling on the requested initial locator. If we invalidate the view pager while loading, the pending locator is cleared and replaced with the current state of thecurrentLocator
.I solved this by adding a
State
in theEpubNavigatorFragment
to monitor the loading of pending locators.currentLocator
will only update after the requested locator finishes loading.