I get a viewPager build up by an FragmentAdapter that contains fragments(each fragment = 1 page on my viewPager). now i know that all my fragment gets created when my viewPager gets created.
Is there a way to make so a fragment only gets created when you swipe/fling to it via the viewPager? or is there a way to track when you swipe/fling to a certain fragment? The reason why i want to do this is, that i got each fragment loading a thread with a httprequest, and i dont want all requests to start at the same time(i only want to start them if the user swipes to the fragment = the user has asked to see the data).
Atm i found out that i can implement ViewPager.IOnPageChangeListener, and set it on the indicators for my viewpagers, but this solution would make all fragments start the same thread( and i want them to start different threads).
Thanks for your time, hope someone out there can help me.