ViewPager.setOffscreenPageLimit(0) doesn't work as expected

前端 未结 11 907
抹茶落季
抹茶落季 2020-11-22 13:02

The fragments I use in my ViewPager instance are quite resource intensive, so I\'d only like to load one at a time. When I try the following:

mV         


        
11条回答
  •  無奈伤痛
    2020-11-22 13:54

    Does ViewPager require a minimum of 1 offscreen pages

    Yes. If I am reading the source code correctly, you should be getting a warning about this in LogCat, something like:

    Requested offscreen page limit 0 too small; defaulting to 1
    

提交回复
热议问题