For the More Curious: How ViewPager Really Works
The ViewPager and PagerAdapter classes handle many things for you behind the scenes. This section will supply more details about what is going on back there.
Two caveats before we get into this discussion: First, according to the documentation, ViewPager is still under development, so these interfaces could change in the future. Second, you do not need to understand the nitty-gritty details in most cases.
But if you need to implement the PagerAdapter interface yourself, you will need to know how the ViewPager-PagerAdapter relationship differs from an ordinary AdapterView-Adapter relationship.
So why is ViewPager not an AdapterView? There is an AdapterView subclass called Gallery that behaves ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access