How to fix ViewPager stop between fragments in Android
This issue I’ve got in one of my projects. I want to share it with you.
There a lot of code. I try to describe the concept.
- I have Activity which have ViewPager
- ViewPager display Fragments each of them have Loader for data retrieving.
- I display data on fragment if onFinishLoader receive data. Rendering data in the Fragment I make in the onFinishLoader method.
My case: I make page flipping very fast. The data loads in the fragment and start rendering while flipping animation in action. This action stop ViewPager between fragments. Below you can see my graphics.
To remove this issue you need just remove all complex functionality from onFinishLoader and replace all View.GONE with View.INVISIBLE.
Let me know if you have better solution.