Viewpager does not save images properly

I have a SherlockFragment that inflates a layout containing a viewpager that allows me to scroll through several fragments of the tabs that I created.
The first time this fragment is tied to my activity, everything works fine and as expected, but if I go back and go into the fragment again, the viewpager or its adapter (it looks like this: "TabAdapter extends FragmentPagerAdapter implements ActionBar. TabListener, ViewPager. OnPageChangeListener ") cause problems:

  • View of fragment stored in viewpager is not displayed
  • Actually, I have 4 tabs, if I set "setOffscreenPageLimit", nothing becomes visible in the viewpager on vacation, no matter what I do;
    if the "setOffscreenPageLimit" parameter is not , the views displayed inside the viewpager are displayed only if I scroll at least two tabs left or right.
  • It also seems that the pager now skips some tabs during scrolling if "setOffscreenPageLimit" is not used .

Thanks for any ideas that could solve this problem.

+4
source share
1 answer

I ran into the same problem. After some research, I found the following thread:

http://code.google.com/p/android/issues/detail?id=19001

Answer No. 10 is what fixed my problem.

0
source

Source: https://habr.com/ru/post/1438876/


All Articles