Beginning RecyclerView - Part 11: Nested | Ray Wenderlich Videos

Create a nested RecyclerView, learn about LinearSnapHelper, and improve performance with a RecycledViewPool.

This is a companion discussion topic for the original entry at

I have some problem with part

holder.itemView.foodRecyclerView.recycledViewPool = viewPool

I am not able to compile due to issue

val cannot be reassigned

Can you please help me with this?

Hi @yogaboy, thanks for the question! It’s possible this could be due to a change in the RecyclerView library. Which version of the library are you using? This also may have changed in AndroidX.

You could try changing the line to this to see if it helps:


Let me know if that helps and thanks again!

Dear @macsimus
Solved! I’m so sorry for my stupid question. You are right!


Of course I am using AndroidX library and I try to find in
RecyclerView.RecycledViewPool  |  Android Developers what’s changed but I was blind… totally blind …

Thank you!