I added a RecyclerView inside my NestedScrollView . I basically want the RecyclerView to scroll along with other views. The problem I ran into is that it works fine for a small data set, but for a large data set (200 records), whenever I start an activity, it freezes for about 3-5 seconds and then loads. I uninstalled NestedScrollView and it works flawlessly, but it does not give me the behavior I want.
(For more information, I'm loading data from an SQLite database. There is no problem scrolling because it is smooth. The only problem is that the activity freezes for a while)
<android.support.v4.widget.NestedScrollView android:layout_width="match_parent" android:layout_height="match_parent"> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <... Some other Views ...> <android.support.v7.widget.RecyclerView android:layout_width="wrap_content" android:layout_height="match_parent" android:orientation="vertical"> </android.support.v7.widget.RecyclerView> </LinearLayout> </android.support.v4.widget.NestedScrollView>
source share