Gabor Varadi
1 min readFeb 26, 2020

--

It’s definitely a possible solution for the same problem. If you are using the Navigation Component, then it can solve this for you. As long as the NavGraph exists on the backstack, it’ll be kept alive for you. It even has a LifecycleOwner, a SavedStateRegistryOwner, and soon even a SavedStateHandle. Although Navigation has some other quirky characteristics, mainly that asymmetric navigation is tricky, and navigating to the same destination twice (quick taps) can cause unexpected errors, so I haven’t switched to using it. They’ll improve its API by moving the DSL from XML to Kotlin, though.

--

--

Gabor Varadi
Gabor Varadi

Written by Gabor Varadi

Android dev. Zhuinden, or EpicPandaForce @ SO. Extension function fan #Kotlin, dislikes multiple Activities/Fragment backstack.

No responses yet