I’m using a ViewPager with multiple Fragments. (Tab navigation + swipe).
In my first ListFragment I’m displaying a list of data with a custom adapter.
The problem is, when swipping to Tab #3 and then back, my ArrayList has size 0.
How can I keep all the data of a Fragment in memory? I don’t want to read it again from the database, all I want is that when returning to this fragment everything should stay the same…
Thanks for your help.
You can:
But bear in mind that whenever your process get killed you will loose the data in any case. If you want the data to persist across multiple process spawn you need to store it into sqllite / some kind of persistence.