> For the complete documentation index, see [llms.txt](https://android-course.cornellappdev.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://android-course.cornellappdev.com/archive/archived-native-android-textbook-pages/5.-listviews/5.2-listview-performance.md).

# 3.2 ListView Performance

### Performance with ListView

With a list view, as a cell is “pushed” off the screen due to scrolling, that cell or `View` object is moved into a `Recycler` (not to be confused with `RecyclerView`) and the same `View` object is **reused** by the system.

![Diagram of how cells are recycled](https://i.stack.imgur.com/VLG9g.jpg)

If we look at the diagram above, when `Item 1` is pushed offscreen, it is saved in the `Recycler` and the `View` object is reused for `Item 8`. This can lead to all sorts of bugs.&#x20;

Let’s say, for example, that every item had a checkbox. If the checkbox in `Item 1` is checked, when the `Item 1`'s cell is reused, we’ll see that `Item 8` is created with the checkbox already checked. The text in `Item 8` has changed, but the `View` object itself has been reused. This is because the `View` objects in a list view are not attached to a certain position or item in the list.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://android-course.cornellappdev.com/archive/archived-native-android-textbook-pages/5.-listviews/5.2-listview-performance.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
