0

How can I make my listview cycle as in when the user reaches the bottom it essentially just reloads the top values and makes it an endless cycle?

Josh
  • 61
  • 9

2 Answers2

1

My thought process for your adapter would be:

  1. Override getCount() and return MAX_INT
  2. For getItem(), return your item at position % actualCount (i.e. if you're using a List called items for the backing data, return items.get(pos % items.size())).
  3. In getView(), make sure that you're always accessing data using getItem() rather than accessing the backing data directly (e.g. don't access items.get(pos), as you'll have to again mod against the length of the list)
Kevin Coppock
  • 133,643
  • 45
  • 263
  • 274
0

This is just off of top of my head, but I think roughly what you could do is, similar to detecting end in infinite-scrolling, when you're at the bottom, append to your ArrayList to itself then call an update like notifyDataSetChanged on the adapter?

Nearalias
  • 25
  • 1
  • 4