Question

I have a Gallery object that scrolls from left to right and back again. However, I would like to make this Gallery circle back on itself, that way when I get to my last View, the very first one is next and I can just keep scrolling. Any ideas? Thanks.

Was it helpful?

Solution

Galleries use an Adapter to back the data that they display. You can create a custom adapter where getCount() returns Integer.MAX_VALUE and getView() does a modulos the position with the number of images you have. This way it always returns the appropriate image for a given position.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top