-1

I have a recyclerview with a lot of items. Some of them are not displayed on the screen. How do I click on a button inside a recyclerview item which is not displayed on the screen?

I know the item position and the button id.

PS: My layout is inside a NestedScrollView.

Leonardo Sibela
  • 1,613
  • 1
  • 18
  • 39

1 Answers1

0

As stated on the documentation:

As the name implies, RecyclerView recycles those individual elements. When an item scrolls off the screen, RecyclerView doesn't destroy its view. Instead, RecyclerView reuses the view for new items that have scrolled onscreen. This reuse vastly improves performance, improving your app's responsiveness and reducing power consumption.

So if the layout of an item is not currently being displayed on the screen you cannot click on it.

Armaggheddon
  • 340
  • 1
  • 10