I am trying to get the number of children RecyclerView. I tried this:
myRView.getChildCount();
And this:
LinearLayoutManager lm = ((LinearLayoutManager)myRViews.getLayoutManager());
lm.getChildCount();
I need the child to look at a certain position, so I need this. If I call getChildAt(index), I never get a child view.
Both of these methods return 0. How else to get the child view from the RecyclerView? My items are displayed correctly and everything is working fine. I call these methods after creating my adapter and installing it in the RecyclerView. Thank you for your help.
source
share