How to make PagerAdapter load all pages

RE6 picture RE6 · Oct 2, 2012 · Viewed 7.3k times · Source


I know that by default PagerAdapter loads only the current, next and previous pages. Is there any way to change it, so it will load each and every page? Thanks!

Answer

UgglyNoodle picture UgglyNoodle · Oct 3, 2012

If you have N pages, you can use setOffscreenPageLimit(N-1), so that it will keep all pages in memory.