Gabor Varadi
1 min readMar 14, 2019

--

You generally don’t put fragments on the stack, you put keys on it that identify a given fragment. I tend to re-use data class and toString() to create a fragment tag — this also takes parameters into account. Then if you use replaceTop() or setHistory() to replace the key, then I’d think even in the sample FragmentStateChanger I provided that ought to remove the fragment with old args, and add the fragment with new args (with a new fragment tag).

--

--

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