I’m using the android-viewflow library (https://github.com/pakerfeldt/android-viewflow) to enable horizontal paging. On each page, I would like to display a ListView of data, different for each page.
The general implementation questions I have are:
- Will I need to create a separate adapter for each ListView on each page or use the same adapter, feed it different data for each page and “Android just knows what to do with it” when I page left/right?
- I’m struggling with the getView method of the adapter that is used for the horizontal paging (not the list view). As I switch pages left/right, I think getView is where I need to implement code that retrieves data to be shown and puts it in the listview on that page. Is this correct or do I need to handle things differently?
Any help is appreciated on understanding this, thanks.
Use fragments and ViewPager. Here is an example