How to fix ViewPager stop between fragments in Android

Published by Igor Khrupin on

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.

  1. I have Activity which have ViewPager
  2. ViewPager display Fragments each of them have Loader for data retrieving.
  3. 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.


Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.