viewpager 预加载会把所有 fragment 里的 onLazyInitView 都调用
Author: gzpaiwxcCreated Jan 14, 2020Updated Aug 20, 2021
Library version fragmentationX 1.0.1
Logs

Screenshots
我用的 Fragment 嵌套 Viewpager , 里面放 4 个 Fragment , setOffscreenPageLimit() 设为 3 , 每次进来都会把 4 个 fragment 预加载了 , 每个页面的 onLazyInitView 都在预加载的时候就调用了 , 这样岂不是都没有懒加载的效果了 ? onLazyInitView 懒加载不是在 fragment 可见的时候才调用的吗 ? 还有就是 onSupportVisible() 也是一样在预加载的时候 4 个 fragment 页面调用了 , 然后第一次切换页面时 , 只会调用上一个显示的 fragment 的 onSupportInVisible 方法 , 不调用要显示的 fragment 的 onSupportVisible 方法 , 第二次切换页面的时候才会调用 要显示的 fragment 的 onSupportVisible 和上一个显示的 fragment 的 onSupportInVisible . 困扰好久 , 请求路过的大神帮帮忙
Source: YoKeyword/Fragmentation