Go To Next Page On View Pager Crashing App - Android


#1

I have a view pager set to dynamic and a single pager view + image inside of the view.

It doesn’t look like i can add multiple pager views to the view pager.

I’m not sure my settings are correct.

I have bound the get call as a datasource to the view pager.

On load of the pager view, I display a URL:

And on the view pager i use a page change event to go to the next view in the view pager (there is only 1) and at that point it seems to crash the app.

I have a list of 5 images in the dynamic view pager i’m trying to allow the user to swipe through left/right but i’m not sure what I’ve done wrong. The 1st image loads in the view correctly, just when i try to go to the next view or ‘page change’ it crashes out unfortunately.


#2

You won’t have multiple Pager Views in a View Pager. Think of that Pager View as the template for all the Pager Views that are created. If your datasource is connected to the elements in your Pager View then when you swipe through, you’ll find the data properly fills the elements for as many View Pagers needed to be created to display all the data elements in the datasource.

I don’t think you need to do anything in that “Page Changed” event. When you swipe over, the View Pager knows “create a Pager View to show the next elements worth of data from the datasource”.

Does that make sense? I know the terminology is all very similar and it can be a tricky thing to type about. If you need more clarity, you can share a Build ID and instructions on creating the crash and I can dig in more.