0

is it possible to make a ListView go endless in both directions? I have 5 items that I want to go like A->B-->C->D->E->A->B... I don't have more than these 5 items, it's a static ListView. Like a circular List with the same 5 items. I have found some endless ListView that load new data when you are at the bottom, but nothing that goes in both directions.

Thanks!

Daniel Storch
  • 327
  • 1
  • 3
  • 15
  • I don't have any data from the database, that's not the problem. I can't figure out how to make a loop. A always contains the same data. Same with B to E. Nothin gonna change there – Daniel Storch Sep 21 '14 at 16:45
  • i think that custom ArrayAdapter would also require 3 or 4 lines of code to be endless – pskink Sep 21 '14 at 16:50
  • actually ArrayAdapter needs two lines of code to be endless... – pskink Sep 21 '14 at 17:03
  • I need endless in both directions! And only show 5 at a time – Daniel Storch Sep 21 '14 at 19:08
  • yes, i know that you need it to be endless in both directions, use custom ArrayAdapter as I said – pskink Sep 21 '14 at 19:09
  • Ok thanks i will try to find some example code, or do you have some you could post? – Daniel Storch Sep 21 '14 at 23:38
  • instead of trying to find something, try to implement it by yourself, it's really **two** lines of code in ArrayAdapter (not counting syntactic stuff when overriding methods), just read the Adapter docs: http://developer.android.com/reference/android/widget/Adapter.html – pskink Sep 22 '14 at 07:10
  • @pskink I was looking for the same thing, but just keeping saying 'it takes only 2, or 3, or 4 lines of code is not really helpful. If it is that little, just put an answer here – Boy Jan 29 '15 at 09:09
  • @Boy what makes adapter has 20 items? its getCount method which return 20, so what would you do to make an adapter endless? – pskink Jan 29 '15 at 09:23
  • @pskink I made it a large number, but does seem to be optimal. I guess I'm missing something ? See my question (I just dropped) here: http://stackoverflow.com/questions/28210665/recyclerview-should-not-have-too-many-items – Boy Jan 29 '15 at 09:26

0 Answers0