Skip to content Skip to sidebar Skip to footer

Android Viewpager W/ Multiple Fragment Classes Each W/ Separate Layout File

My app uses the android.support.v4.view.ViewPager class. For each page in the ViewPager, I want there to be one Fragment, each with its own layout file. Each Fragment is defined in

Solution 1:

Just return proper Fragment instance in getItem(int position) by position. use switch~case, It's easy.


Post a Comment for "Android Viewpager W/ Multiple Fragment Classes Each W/ Separate Layout File"