How do I disable page pre loading in Viewpager??
I tried
viewPager.setOffscreenPageLimit(0)
but it's not working.
How do I disable page pre loading in Viewpager??
I tried
viewPager.setOffscreenPageLimit(0)
but it's not working.
use this viewPager.setOffscreenPageLimit(1)
instead of viewPager.setOffscreenPageLimit(0)
. because the minimum value of setOffscreenPageLimit()
is 1.
Have a look at this.
According to Ali Imran you can try this:
setCount()
getCount()
function of Adapter return the count variablepageScroll()
function of the ViewPager when the
user flips the page you can call the setCount()
to increase the
count of the count variable