ViewPager

Download android eBook

Introduction

ViewPager is a Layout manager that allows the user to flip left and right through pages of data. It is most often used in conjunction with Fragment, which is a convenient way to supply and manage the lifecycle of each page.

Remarks

One important thing to note about ViewPager usage is that there are two different versions of both FragmentPagerAdapter and FragmentStatePagerAdapter.

If you are using android.app.Fragment native Fragments with a FragmentPagerAdapter or FragmentStatePagerAdapter, you need to use the v13 support library versions of the adapter, i.e. android.support.v13.app.FragmentStatePagerAdapter.

If you are using android.support.v4.app.Fragment support library Fragments with a FragmentPagerAdapter or FragmentStatePagerAdapter, you need to use the v4 support library versions of the adapter, i.e. android.support.v4.app.FragmentStatePagerAdapter.

Related Examples

Stats

790 Contributors: 12
Thursday, August 3, 2017
Licensed under: CC-BY-SA

Not affiliated with Stack Overflow
Rip Tutorial: info@zzzprojects.com

Download eBook