Open giusecapo opened 7 years ago
are you using ViewPager in your fragments? if so you need to setOffscreenPageLimit
to how many fragments there is inside your viewpager
Hi, I'm not using wiewpager, i just run your samplecode. I'm facing the same problem. In your sample code, onCreateView is called everytime but listviews does not recreated. I don't know why listview not recreate but others views that i added are recreates. (I added a textView with random number that i generate in onCreateview. And textview's text changed every time)
When switching tabs, fragments are replaced, and the previous fragment putted into backstack with saved state. If you switch back, the fragment is recreated and restores its own state from the saved state.
How can we prevent to lose the current status of the fragment?
I add more details: I'm building an app that has a tinder-like UI with cards. If user scrolls the cards deck, then change fragment, when it comes back the deck is re-load. I need to maintain the position, aka restore view status