Skip to content Skip to sidebar Skip to footer

Performance Issue With Loading Large Data In Recyclerview In A Viewpager

My setup consists of two tabs setup with viewpager. Each tab contains a fragment which contains a recyclerview that displays list of songs. The issue is, when loading large amount

Solution 1:

So I found the root course of the problem. Recyclerview inside NestedScrollView. Because I have like three RecyclerViews to display, I had to use NestedScrollView to wrap them. But then from this question, I understood that having recyclerview inside nestedScrollView will make the recyclerview want to create all the views at once before rendering them. So that was why the UI froze each time data is to be displayed.

Solution 2:

if you just want to display basic info of songs, you can use List as data, in SongInfo contains name,album,singer...etc, it won't take much memory

Solution 3:

Easy. Just set layoutManager autoMeasureEnable = true or override LayoutmanlayoutManager.setAutoMeasureEnabled(false)

Post a Comment for "Performance Issue With Loading Large Data In Recyclerview In A Viewpager"