-5

in recyclerView when I set on Click Listener to my viewHolders how android handles this with callbacks?

which one is correct:

  • android creates listeners as much as we have items in memory
  • android creates one callback and many pointers to that callback?

1 Answers1

1

Erm, the RecyclerView, recycles it view. So only the views viewable and a few each side would have listeners, and then once the user scrolls, the ones now not showing would be recreated into ones closer to the current scroll position.

So how many listeners you would have active at one time would depend on how many views are currently present +- a few each side.

Scott Johnson
  • 707
  • 5
  • 13