I have an activity and i implement the android TabLayout with recyclerview. I implemented three fragments for the three tabs of the TabLayout.
The default load behavior of the TabLayout it will load and cache the neighbor tab but not the one that already loaded.
let's say Fragment A, B and C correspond to tab 1, 2 and 3 respectively.
- When users visit tab 1 ---> Fragment A and B loaded
- When users visit tab 2 ---> Fragment C loaded
- But when users visit tab 1 again --> Fragment A load again.
What I want is when the activity start, I want all the three tabs load only once, then I can load the tab through refresh mechanism such as the swipe refresh.
Are there any way I can change the load behavior of the TabLayout?
Thanks,