It's a container for displaying large, scrollable data sets efficiently by maintaining a limited number of View items. The RecyclerView class is a more advanced and flexible version of ListView. Then reuse the View items with different data as list items scroll in and out of the display. To accomplish both these goals, create more View items than the user can see on the screen and cache the created View items. To save time, minimize the number of View items you have to create.To conserve memory, minimize the number of View items that exist at any given point.If you create a new View every time the data changes, that's a lot of View items, even for a small dataset.įrom a performance perspective, you want to conserve memory and save time: Or you may have a dataset that changes as the user interacts with it. For example, in a long list of words or news headlines, the user only sees a few items at a time. When you display a large number of items in a scrollable list, most of the items aren't visible. Lesson 3: Testing, debugging, and using support libraries
0 Comments
Leave a Reply. |